合并分支 'empt' 到 'master'
Empt 升级element版本。用户管理及部门管理还要优化 查看合并请求 !1
正在显示
46 个修改的文件
包含
3681 行增加
和
172 行删除
| @@ -23,13 +23,13 @@ module.exports = { | @@ -23,13 +23,13 @@ module.exports = { | ||
| 23 | }, | 23 | }, |
| 24 | dev: { | 24 | dev: { |
| 25 | env: require('./dev.env'), | 25 | env: require('./dev.env'), |
| 26 | - port: 8082, | 26 | + port: 8001, |
| 27 | autoOpenBrowser: true, | 27 | autoOpenBrowser: true, |
| 28 | assetsSubDirectory: 'static', | 28 | assetsSubDirectory: 'static', |
| 29 | assetsPublicPath: '/', | 29 | assetsPublicPath: '/', |
| 30 | proxyTable: { | 30 | proxyTable: { |
| 31 | '/api':{ | 31 | '/api':{ |
| 32 | - target: 'http://127.0.0.1:7003',//设置你调用的接口域名和端口号 别忘了加http | 32 | + target: 'http://192.168.1.53:12343',//设置你调用的接口域名和端口号 别忘了加http |
| 33 | changeOrigin: true, | 33 | changeOrigin: true, |
| 34 | pathRewrite: { | 34 | pathRewrite: { |
| 35 | '^/api': '/'//这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可 | 35 | '^/api': '/'//这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可 |
| @@ -975,6 +975,12 @@ | @@ -975,6 +975,12 @@ | ||
| 975 | "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", | 975 | "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", |
| 976 | "dev": true | 976 | "dev": true |
| 977 | }, | 977 | }, |
| 978 | + "babel-plugin-syntax-jsx": { | ||
| 979 | + "version": "6.18.0", | ||
| 980 | + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", | ||
| 981 | + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", | ||
| 982 | + "dev": true | ||
| 983 | + }, | ||
| 978 | "babel-plugin-syntax-object-rest-spread": { | 984 | "babel-plugin-syntax-object-rest-spread": { |
| 979 | "version": "6.13.0", | 985 | "version": "6.13.0", |
| 980 | "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", | 986 | "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", |
| @@ -1317,6 +1323,15 @@ | @@ -1317,6 +1323,15 @@ | ||
| 1317 | "babel-types": "^6.24.1" | 1323 | "babel-types": "^6.24.1" |
| 1318 | } | 1324 | } |
| 1319 | }, | 1325 | }, |
| 1326 | + "babel-plugin-transform-vue-jsx": { | ||
| 1327 | + "version": "3.7.0", | ||
| 1328 | + "resolved": "https://registry.npmjs.org/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-3.7.0.tgz", | ||
| 1329 | + "integrity": "sha512-W39X07/n3oJMQd8tALBO+440NraGSF//Lo1ydd/9Nme3+QiRGFBb1Q39T9iixh0jZPPbfv3so18tNoIgLatymw==", | ||
| 1330 | + "dev": true, | ||
| 1331 | + "requires": { | ||
| 1332 | + "esutils": "^2.0.2" | ||
| 1333 | + } | ||
| 1334 | + }, | ||
| 1320 | "babel-polyfill": { | 1335 | "babel-polyfill": { |
| 1321 | "version": "6.26.0", | 1336 | "version": "6.26.0", |
| 1322 | "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", | 1337 | "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", |
| @@ -3227,13 +3242,15 @@ | @@ -3227,13 +3242,15 @@ | ||
| 3227 | "dev": true | 3242 | "dev": true |
| 3228 | }, | 3243 | }, |
| 3229 | "element-ui": { | 3244 | "element-ui": { |
| 3230 | - "version": "1.4.13", | ||
| 3231 | - "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-1.4.13.tgz", | ||
| 3232 | - "integrity": "sha512-EGdw/qC2RUmCDzAy3X06LL+jDWmrMezMndviE5CnUDi2XcZz/uZUVVj6bJ6piY+Flw7HNO+Ed81LXrdZ2v+nXA==", | 3245 | + "version": "2.13.0", |
| 3246 | + "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.13.0.tgz", | ||
| 3247 | + "integrity": "sha512-KYsHWsBXYbLELS8cdfvgJTOMSUby3UEjvsPV1V1VmgJ/DdkOAS4z3MiOrPxrT9w2Cc5lZ4eVSQiGhYFR5NVChw==", | ||
| 3233 | "requires": { | 3248 | "requires": { |
| 3234 | "async-validator": "~1.8.1", | 3249 | "async-validator": "~1.8.1", |
| 3235 | "babel-helper-vue-jsx-merge-props": "^2.0.0", | 3250 | "babel-helper-vue-jsx-merge-props": "^2.0.0", |
| 3236 | "deepmerge": "^1.2.0", | 3251 | "deepmerge": "^1.2.0", |
| 3252 | + "normalize-wheel": "^1.0.1", | ||
| 3253 | + "resize-observer-polyfill": "^1.5.0", | ||
| 3237 | "throttle-debounce": "^1.0.1" | 3254 | "throttle-debounce": "^1.0.1" |
| 3238 | } | 3255 | } |
| 3239 | }, | 3256 | }, |
| @@ -6294,6 +6311,11 @@ | @@ -6294,6 +6311,11 @@ | ||
| 6294 | "sort-keys": "^1.0.0" | 6311 | "sort-keys": "^1.0.0" |
| 6295 | } | 6312 | } |
| 6296 | }, | 6313 | }, |
| 6314 | + "normalize-wheel": { | ||
| 6315 | + "version": "1.0.1", | ||
| 6316 | + "resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz", | ||
| 6317 | + "integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU=" | ||
| 6318 | + }, | ||
| 6297 | "npm": { | 6319 | "npm": { |
| 6298 | "version": "6.10.3", | 6320 | "version": "6.10.3", |
| 6299 | "resolved": "https://registry.npmjs.org/npm/-/npm-6.10.3.tgz", | 6321 | "resolved": "https://registry.npmjs.org/npm/-/npm-6.10.3.tgz", |
| @@ -11118,6 +11140,11 @@ | @@ -11118,6 +11140,11 @@ | ||
| 11118 | "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", | 11140 | "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", |
| 11119 | "dev": true | 11141 | "dev": true |
| 11120 | }, | 11142 | }, |
| 11143 | + "resize-observer-polyfill": { | ||
| 11144 | + "version": "1.5.1", | ||
| 11145 | + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", | ||
| 11146 | + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" | ||
| 11147 | + }, | ||
| 11121 | "resolve": { | 11148 | "resolve": { |
| 11122 | "version": "1.12.0", | 11149 | "version": "1.12.0", |
| 11123 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", | 11150 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", |
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | "dependencies": { | 12 | "dependencies": { |
| 13 | "axios": "^0.19.0", | 13 | "axios": "^0.19.0", |
| 14 | "echarts": "^3.3.2", | 14 | "echarts": "^3.3.2", |
| 15 | - "element-ui": "^1.2.8", | 15 | + "element-ui": "^2.13.0", |
| 16 | "eslint": "^5.14.1", | 16 | "eslint": "^5.14.1", |
| 17 | "file-saver": "^2.0.2", | 17 | "file-saver": "^2.0.2", |
| 18 | "font-awesome": "^4.7.0", | 18 | "font-awesome": "^4.7.0", |
| @@ -33,10 +33,13 @@ | @@ -33,10 +33,13 @@ | ||
| 33 | "autoprefixer": "^6.7.2", | 33 | "autoprefixer": "^6.7.2", |
| 34 | "axios-mock-adapter": "^1.7.1", | 34 | "axios-mock-adapter": "^1.7.1", |
| 35 | "babel-core": "^6.22.1", | 35 | "babel-core": "^6.22.1", |
| 36 | + "babel-helper-vue-jsx-merge-props": "^2.0.3", | ||
| 36 | "babel-loader": "^6.2.10", | 37 | "babel-loader": "^6.2.10", |
| 38 | + "babel-plugin-syntax-jsx": "^6.18.0", | ||
| 37 | "babel-plugin-transform-runtime": "^6.22.0", | 39 | "babel-plugin-transform-runtime": "^6.22.0", |
| 40 | + "babel-plugin-transform-vue-jsx": "^3.7.0", | ||
| 38 | "babel-polyfill": "^6.16.0", | 41 | "babel-polyfill": "^6.16.0", |
| 39 | - "babel-preset-env": "^1.2.1", | 42 | + "babel-preset-env": "^1.7.0", |
| 40 | "babel-preset-es2015": "^6.0.0", | 43 | "babel-preset-es2015": "^6.0.0", |
| 41 | "babel-preset-stage-2": "^6.22.0", | 44 | "babel-preset-stage-2": "^6.22.0", |
| 42 | "babel-register": "^6.22.0", | 45 | "babel-register": "^6.22.0", |
| @@ -7,7 +7,7 @@ Vue.prototype.$http = axios; | @@ -7,7 +7,7 @@ Vue.prototype.$http = axios; | ||
| 7 | 7 | ||
| 8 | export const getuserMenus = params => { return axios.get(`/perm/userMenus`, { params: params }); }; | 8 | export const getuserMenus = params => { return axios.get(`/perm/userMenus`, { params: params }); }; |
| 9 | 9 | ||
| 10 | -export const getUserList = params => { return axios.get(`/user/list`, { params: params }); }; | 10 | +export const getUserList = params => { return axios.get(`/hqpt-user-center/user/list`, { params: params }); }; |
| 11 | 11 | ||
| 12 | export const getUserListPage = params => { return axios({ | 12 | export const getUserListPage = params => { return axios({ |
| 13 | method: 'GET', | 13 | method: 'GET', |
src/api/base.js
0 → 100644
src/api/company.js
0 → 100755
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = '/hqpt-user-center/company'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +export const remove = params => { return axios({ | ||
| 10 | + method: 'DELETE', | ||
| 11 | + url: `${base}/del`, | ||
| 12 | + data: params, | ||
| 13 | + headers: { | ||
| 14 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 15 | + } | ||
| 16 | +})}; | ||
| 17 | + | ||
| 18 | +//批量删除 | ||
| 19 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 20 | + | ||
| 21 | +export const edit = params => { return axios({ | ||
| 22 | + method: 'PUT', | ||
| 23 | + url: `${base}/edit`, | ||
| 24 | + data: params, | ||
| 25 | + headers: { | ||
| 26 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 27 | + } | ||
| 28 | +})}; | ||
| 29 | + | ||
| 30 | +export const add = params => { return axios({ | ||
| 31 | + method: 'POST', | ||
| 32 | + url: `${base}/add`, | ||
| 33 | + data: params, | ||
| 34 | + headers: { | ||
| 35 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 36 | + } | ||
| 37 | +})}; |
src/api/department.js
0 → 100755
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = '/hqpt-user-center/department'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +export const remove = params => { return axios({ | ||
| 10 | + method: 'DELETE', | ||
| 11 | + url: `${base}/del`, | ||
| 12 | + data: params, | ||
| 13 | + headers: { | ||
| 14 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 15 | + } | ||
| 16 | +})}; | ||
| 17 | + | ||
| 18 | +//批量删除 | ||
| 19 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 20 | + | ||
| 21 | +export const edit = params => { return axios({ | ||
| 22 | + method: 'PUT', | ||
| 23 | + url: `${base}/edit`, | ||
| 24 | + data: params, | ||
| 25 | + headers: { | ||
| 26 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 27 | + } | ||
| 28 | +})}; | ||
| 29 | + | ||
| 30 | +export const add = params => { return axios({ | ||
| 31 | + method: 'POST', | ||
| 32 | + url: `${base}/add`, | ||
| 33 | + data: params, | ||
| 34 | + headers: { | ||
| 35 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 36 | + } | ||
| 37 | +})}; |
src/api/empt/location_api.js
0 → 100644
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = 'empt-location/location'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +export const remove = params => { return axios({ | ||
| 10 | + method: 'DELETE', | ||
| 11 | + url: `${base}/del`, | ||
| 12 | + data: params, | ||
| 13 | + headers: { | ||
| 14 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 15 | + } | ||
| 16 | +})}; | ||
| 17 | + | ||
| 18 | +//批量删除 | ||
| 19 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 20 | + | ||
| 21 | +export const edit = params => { return axios({ | ||
| 22 | + method: 'PUT', | ||
| 23 | + url: `${base}/edit`, | ||
| 24 | + data: params, | ||
| 25 | + headers: { | ||
| 26 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 27 | + } | ||
| 28 | +})}; | ||
| 29 | + | ||
| 30 | +export const add = params => { return axios({ | ||
| 31 | + method: 'POST', | ||
| 32 | + url: `${base}/add`, | ||
| 33 | + params: params, | ||
| 34 | + headers: { | ||
| 35 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 36 | + } | ||
| 37 | +})}; | ||
| 38 | + | ||
| 39 | +export const update = params => { return axios({ | ||
| 40 | + method: 'PUT', | ||
| 41 | + url: `${base}/update`, | ||
| 42 | + data: params, | ||
| 43 | + headers: { | ||
| 44 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 45 | + } | ||
| 46 | +})}; |
src/api/group_company.js
0 → 100755
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = '/hqpt-user-center/group'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +export const remove = params => { return axios({ | ||
| 10 | + method: 'DELETE', | ||
| 11 | + url: `${base}/del`, | ||
| 12 | + data: params, | ||
| 13 | + headers: { | ||
| 14 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 15 | + } | ||
| 16 | +})}; | ||
| 17 | + | ||
| 18 | +//批量删除 | ||
| 19 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 20 | + | ||
| 21 | +export const edit = params => { return axios({ | ||
| 22 | + method: 'PUT', | ||
| 23 | + url: `${base}/edit`, | ||
| 24 | + data: params, | ||
| 25 | + headers: { | ||
| 26 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 27 | + } | ||
| 28 | +})}; | ||
| 29 | + | ||
| 30 | +export const add = params => { return axios({ | ||
| 31 | + method: 'POST', | ||
| 32 | + url: `${base}/add`, | ||
| 33 | + data: params, | ||
| 34 | + headers: { | ||
| 35 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 36 | + } | ||
| 37 | +})}; |
src/api/http.js
100644 → 100755
| @@ -17,9 +17,9 @@ export default { | @@ -17,9 +17,9 @@ export default { | ||
| 17 | return axios({ | 17 | return axios({ |
| 18 | method: 'GET', | 18 | method: 'GET', |
| 19 | url: url, | 19 | url: url, |
| 20 | - data: params, | 20 | + params: params, |
| 21 | headers: { | 21 | headers: { |
| 22 | - 'Content-Type': 'application/json;charset=UTF-8', | 22 | + 'Content-Type': 'application/x-www-form-urlencoded' |
| 23 | } | 23 | } |
| 24 | }); | 24 | }); |
| 25 | }, | 25 | }, |
| @@ -46,7 +46,7 @@ export default { | @@ -46,7 +46,7 @@ export default { | ||
| 46 | login: data =>{ | 46 | login: data =>{ |
| 47 | return axios({ | 47 | return axios({ |
| 48 | method: 'POST', // 请求协议 | 48 | method: 'POST', // 请求协议 |
| 49 | - url: '/login', // 请求的地址 | 49 | + url: 'hqpt-user-center/login', // 请求的地址 |
| 50 | data: qs.stringify(data), // post 请求的数据 | 50 | data: qs.stringify(data), // post 请求的数据 |
| 51 | timeout: 30000, // 超时时间, 单位毫秒 | 51 | timeout: 30000, // 超时时间, 单位毫秒 |
| 52 | headers: { | 52 | headers: { |
src/api/job_api.js
0 → 100644
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = 'hqpt-process/job'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +export const remove = params => { return axios({ | ||
| 10 | + method: 'DELETE', | ||
| 11 | + url: `${base}/del`, | ||
| 12 | + data: params, | ||
| 13 | + headers: { | ||
| 14 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 15 | + } | ||
| 16 | +})}; | ||
| 17 | + | ||
| 18 | +//批量删除 | ||
| 19 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 20 | + | ||
| 21 | +export const edit = params => { return axios({ | ||
| 22 | + method: 'PUT', | ||
| 23 | + url: `${base}/edit`, | ||
| 24 | + data: params, | ||
| 25 | + headers: { | ||
| 26 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 27 | + } | ||
| 28 | +})}; | ||
| 29 | + | ||
| 30 | +export const add = params => { return axios({ | ||
| 31 | + method: 'POST', | ||
| 32 | + url: `${base}/add`, | ||
| 33 | + params: params, | ||
| 34 | + headers: { | ||
| 35 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 36 | + } | ||
| 37 | +})}; | ||
| 38 | + | ||
| 39 | +export const startJob = params => { return axios({ | ||
| 40 | + method: 'PUT', | ||
| 41 | + url: `${base}/start`, | ||
| 42 | + data: params, | ||
| 43 | + headers: { | ||
| 44 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 45 | + } | ||
| 46 | +})}; |
src/api/log_api.js
100644 → 100755
| 1 | import axios from 'axios' | 1 | import axios from 'axios' |
| 2 | 2 | ||
| 3 | -axios.defaults.baseURL = 'http://localhost:8082/api'; | ||
| 4 | -let base = axios.defaults.baseURL+'/system/log'; | 3 | +let base = '/hqpt-user-center/system/log'; |
| 5 | 4 | ||
| 6 | 5 | ||
| 7 | export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | 6 | export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; |
| 1 | import axios from 'axios' | 1 | import axios from 'axios' |
| 2 | 2 | ||
| 3 | -axios.defaults.baseURL = 'http://localhost:8082/api'; | ||
| 4 | -let base = axios.defaults.baseURL+'/perm'; | 3 | +let base = '/hqpt-user-center/perm'; |
| 5 | 4 | ||
| 6 | 5 | ||
| 7 | export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | 6 | export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; |
src/api/process_api.js
0 → 100644
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = 'hqpt-process/process'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +export const remove = params => { return axios({ | ||
| 10 | + method: 'DELETE', | ||
| 11 | + url: `${base}/del`, | ||
| 12 | + data: params, | ||
| 13 | + headers: { | ||
| 14 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 15 | + } | ||
| 16 | +})}; | ||
| 17 | + | ||
| 18 | +//批量删除 | ||
| 19 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 20 | + | ||
| 21 | +export const edit = params => { return axios({ | ||
| 22 | + method: 'PUT', | ||
| 23 | + url: `${base}/edit`, | ||
| 24 | + data: params, | ||
| 25 | + headers: { | ||
| 26 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 27 | + } | ||
| 28 | +})}; | ||
| 29 | + | ||
| 30 | +export const add = params => { return axios({ | ||
| 31 | + method: 'POST', | ||
| 32 | + url: `${base}/add`, | ||
| 33 | + params: params, | ||
| 34 | + headers: { | ||
| 35 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 36 | + } | ||
| 37 | +})}; | ||
| 38 | + | ||
| 39 | +export const updateRolePerm = params => { return axios({ | ||
| 40 | + method: 'PUT', | ||
| 41 | + url: `${base}/permSet`, | ||
| 42 | + data: params, | ||
| 43 | + headers: { | ||
| 44 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 45 | + } | ||
| 46 | +})}; | ||
| 47 | + | ||
| 48 | +export const vacationTypeOptions = [ | ||
| 49 | + { | ||
| 50 | + value: '0', | ||
| 51 | + label: '运维检查' | ||
| 52 | + }, | ||
| 53 | + { | ||
| 54 | + value: '1', | ||
| 55 | + label: '设备故障' | ||
| 56 | + }, | ||
| 57 | + { | ||
| 58 | + value: '2', | ||
| 59 | + label: '电话报修' | ||
| 60 | + } | ||
| 61 | +]; |
| 1 | import axios from 'axios' | 1 | import axios from 'axios' |
| 2 | 2 | ||
| 3 | -let base = '/role'; | 3 | +let base = '/hqpt-user-center/role'; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | 6 | export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; |
| @@ -16,7 +16,7 @@ export const remove = params => { return axios({ | @@ -16,7 +16,7 @@ export const remove = params => { return axios({ | ||
| 16 | })}; | 16 | })}; |
| 17 | 17 | ||
| 18 | //批量删除 | 18 | //批量删除 |
| 19 | -export const batchRemove = params => { return axios.get(`${base}/user/batchremove`, { params: params }); }; | 19 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; |
| 20 | 20 | ||
| 21 | export const edit = params => { return axios({ | 21 | export const edit = params => { return axios({ |
| 22 | method: 'PUT', | 22 | method: 'PUT', |
src/api/staff/come_car.js
0 → 100755
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = '/hqpt-user-center/come_car'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + | ||
| 7 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +export const remove = params => { return axios({ | ||
| 11 | + method: 'DELETE', | ||
| 12 | + url: `${base}/del`, | ||
| 13 | + data: params, | ||
| 14 | + headers: { | ||
| 15 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 16 | + } | ||
| 17 | +})}; | ||
| 18 | + | ||
| 19 | +//批量删除 | ||
| 20 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 21 | + | ||
| 22 | +export const edit = params => { return axios({ | ||
| 23 | + method: 'PUT', | ||
| 24 | + url: `${base}/edit`, | ||
| 25 | + data: params, | ||
| 26 | + headers: { | ||
| 27 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 28 | + } | ||
| 29 | +})}; | ||
| 30 | + | ||
| 31 | +export const add = params => { return axios({ | ||
| 32 | + method: 'POST', | ||
| 33 | + url: `${base}/add`, | ||
| 34 | + data: params, | ||
| 35 | + headers: { | ||
| 36 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 37 | + } | ||
| 38 | +})}; |
src/api/staff/key.js
0 → 100755
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = '/hqpt-user-center/key'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + | ||
| 7 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +export const remove = params => { return axios({ | ||
| 11 | + method: 'DELETE', | ||
| 12 | + url: `${base}/del`, | ||
| 13 | + data: params, | ||
| 14 | + headers: { | ||
| 15 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 16 | + } | ||
| 17 | +})}; | ||
| 18 | + | ||
| 19 | +//批量删除 | ||
| 20 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 21 | + | ||
| 22 | +export const edit = params => { return axios({ | ||
| 23 | + method: 'PUT', | ||
| 24 | + url: `${base}/edit`, | ||
| 25 | + data: params, | ||
| 26 | + headers: { | ||
| 27 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 28 | + } | ||
| 29 | +})}; | ||
| 30 | + | ||
| 31 | +export const add = params => { return axios({ | ||
| 32 | + method: 'POST', | ||
| 33 | + url: `${base}/add`, | ||
| 34 | + data: params, | ||
| 35 | + headers: { | ||
| 36 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 37 | + } | ||
| 38 | +})}; |
src/api/staff/maintain.js
0 → 100755
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = '/hqpt-user-center/maintain'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + | ||
| 7 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +export const remove = params => { return axios({ | ||
| 11 | + method: 'DELETE', | ||
| 12 | + url: `${base}/del`, | ||
| 13 | + data: params, | ||
| 14 | + headers: { | ||
| 15 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 16 | + } | ||
| 17 | +})}; | ||
| 18 | + | ||
| 19 | +//批量删除 | ||
| 20 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 21 | + | ||
| 22 | +export const edit = params => { return axios({ | ||
| 23 | + method: 'PUT', | ||
| 24 | + url: `${base}/edit`, | ||
| 25 | + data: params, | ||
| 26 | + headers: { | ||
| 27 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 28 | + } | ||
| 29 | +})}; | ||
| 30 | + | ||
| 31 | +export const add = params => { return axios({ | ||
| 32 | + method: 'POST', | ||
| 33 | + url: `${base}/add`, | ||
| 34 | + data: params, | ||
| 35 | + headers: { | ||
| 36 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 37 | + } | ||
| 38 | +})}; |
src/api/staff/on_duty.js
0 → 100755
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = '/hqpt-user-center/on_duty'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + | ||
| 7 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +export const remove = params => { return axios({ | ||
| 11 | + method: 'DELETE', | ||
| 12 | + url: `${base}/del`, | ||
| 13 | + data: params, | ||
| 14 | + headers: { | ||
| 15 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 16 | + } | ||
| 17 | +})}; | ||
| 18 | + | ||
| 19 | +//批量删除 | ||
| 20 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 21 | + | ||
| 22 | +export const edit = params => { return axios({ | ||
| 23 | + method: 'PUT', | ||
| 24 | + url: `${base}/edit`, | ||
| 25 | + data: params, | ||
| 26 | + headers: { | ||
| 27 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 28 | + } | ||
| 29 | +})}; | ||
| 30 | + | ||
| 31 | +export const add = params => { return axios({ | ||
| 32 | + method: 'POST', | ||
| 33 | + url: `${base}/add`, | ||
| 34 | + data: params, | ||
| 35 | + headers: { | ||
| 36 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 37 | + } | ||
| 38 | +})}; |
src/api/staff/security_inspection.js
0 → 100755
| 1 | +import axios from 'axios' | ||
| 2 | + | ||
| 3 | +let base = '/hqpt-user-center/inspection'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + | ||
| 7 | +export const getList = params => { return axios.get(`${base}/list`, { params: params }); }; | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +export const remove = params => { return axios({ | ||
| 11 | + method: 'DELETE', | ||
| 12 | + url: `${base}/del`, | ||
| 13 | + data: params, | ||
| 14 | + headers: { | ||
| 15 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 16 | + } | ||
| 17 | +})}; | ||
| 18 | + | ||
| 19 | +//批量删除 | ||
| 20 | +export const batchRemove = params => { return axios.get(`${base}/batchremove`, { params: params }); }; | ||
| 21 | + | ||
| 22 | +export const edit = params => { return axios({ | ||
| 23 | + method: 'PUT', | ||
| 24 | + url: `${base}/edit`, | ||
| 25 | + data: params, | ||
| 26 | + headers: { | ||
| 27 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 28 | + } | ||
| 29 | +})}; | ||
| 30 | + | ||
| 31 | +export const add = params => { return axios({ | ||
| 32 | + method: 'POST', | ||
| 33 | + url: `${base}/add`, | ||
| 34 | + data: params, | ||
| 35 | + headers: { | ||
| 36 | + 'Content-Type': 'application/json;charset=UTF-8' | ||
| 37 | + } | ||
| 38 | +})}; |
src/api/tools.js
100644 → 100755
src/api/user.js
100644 → 100755
| 1 | import http from './http.js' | 1 | import http from './http.js' |
| 2 | -let baseUrl = '/user' | 2 | +let baseUrl = '/hqpt-user-center/user' |
| 3 | 3 | ||
| 4 | export const getUserList = params => { return http.get(`${baseUrl}/list`, params); }; | 4 | export const getUserList = params => { return http.get(`${baseUrl}/list`, params); }; |
| 5 | 5 |
src/axios.js
100644 → 100755
| 1 | var SIGN_REGEXP = /([yMdhsm])(\1*)/g; | 1 | var SIGN_REGEXP = /([yMdhsm])(\1*)/g; |
| 2 | var DEFAULT_PATTERN = 'yyyy-MM-dd'; | 2 | var DEFAULT_PATTERN = 'yyyy-MM-dd'; |
| 3 | + | ||
| 3 | function padding(s, len) { | 4 | function padding(s, len) { |
| 4 | var len = len - (s + '').length; | 5 | var len = len - (s + '').length; |
| 5 | for (var i = 0; i < len; i++) { s = '0' + s; } | 6 | for (var i = 0; i < len; i++) { s = '0' + s; } |
| 1 | -import babelpolyfill from 'babel-polyfill' | 1 | + |
| 2 | import Vue from 'vue' | 2 | import Vue from 'vue' |
| 3 | import App from './App' | 3 | import App from './App' |
| 4 | -import ElementUI from 'element-ui' | ||
| 5 | -import 'element-ui/lib/theme-default/index.css' | 4 | +import 'element-ui/lib/theme-chalk/index.css' |
| 6 | //import './assets/theme/theme-green/index.css' | 5 | //import './assets/theme/theme-green/index.css' |
| 7 | import VueRouter from 'vue-router' | 6 | import VueRouter from 'vue-router' |
| 8 | import store from './vuex/store' | 7 | import store from './vuex/store' |
| 9 | import Vuex from 'vuex' | 8 | import Vuex from 'vuex' |
| 10 | import axios from 'axios' | 9 | import axios from 'axios' |
| 11 | -//import NProgress from 'nprogress' | ||
| 12 | -//import 'nprogress/nprogress.css' | ||
| 13 | import rout from './routes' | 10 | import rout from './routes' |
| 14 | import Mock from './mock' | 11 | import Mock from './mock' |
| 15 | import i18n from './lang' | 12 | import i18n from './lang' |
| 16 | import 'font-awesome/css/font-awesome.min.css' | 13 | import 'font-awesome/css/font-awesome.min.css' |
| 14 | +import ElementUI from 'element-ui' | ||
| 17 | 15 | ||
| 18 | //定义一个全局过滤器实现日期格式化 | 16 | //定义一个全局过滤器实现日期格式化 |
| 19 | Vue.filter('datefmt',function(input,fmtstring){ | 17 | Vue.filter('datefmt',function(input,fmtstring){ |
| @@ -7,6 +7,11 @@ import Role from './views/nav1/role.vue' | @@ -7,6 +7,11 @@ import Role from './views/nav1/role.vue' | ||
| 7 | import Perm from './views/nav1/perm.vue' | 7 | import Perm from './views/nav1/perm.vue' |
| 8 | import LOG from './views/nav1/Log.vue' | 8 | import LOG from './views/nav1/Log.vue' |
| 9 | import PreManifest from './views/agent/PreManifest.vue' | 9 | import PreManifest from './views/agent/PreManifest.vue' |
| 10 | +import Company from './views/nav1/company.vue' | ||
| 11 | +import Department from './views/nav1/department.vue' | ||
| 12 | +import Group from './views/nav1/groupcompany.vue' | ||
| 13 | +import Process from './views/hqpt/Process.vue' | ||
| 14 | +import Job from './views/hqpt/Job.vue' | ||
| 10 | // import Form from './views/nav1/Form.vue' | 15 | // import Form from './views/nav1/Form.vue' |
| 11 | 16 | ||
| 12 | import User from './views/nav1/user.vue' | 17 | import User from './views/nav1/user.vue' |
| @@ -14,6 +19,12 @@ import Page4 from './views/nav2/Page4.vue' | @@ -14,6 +19,12 @@ import Page4 from './views/nav2/Page4.vue' | ||
| 14 | import Page5 from './views/nav2/Page5.vue' | 19 | import Page5 from './views/nav2/Page5.vue' |
| 15 | import Page6 from './views/nav3/Page6.vue' | 20 | import Page6 from './views/nav3/Page6.vue' |
| 16 | import echarts from './views/charts/echarts.vue' | 21 | import echarts from './views/charts/echarts.vue' |
| 22 | +import SecrityInspection from './views/staff/security_inspection.vue' | ||
| 23 | +import Key from './views/staff/key.vue' | ||
| 24 | +import Maintain from './views/staff/maintain.vue' | ||
| 25 | +import ComeCar from './views/staff/come_car.vue' | ||
| 26 | +import OnDuty from './views/staff/on_duty.vue' | ||
| 27 | +import Location from './views/empt/Location.vue' | ||
| 17 | 28 | ||
| 18 | let routes = [ | 29 | let routes = [ |
| 19 | { | 30 | { |
| @@ -46,29 +57,42 @@ let routes = [ | @@ -46,29 +57,42 @@ let routes = [ | ||
| 46 | iconCls: 'el-icon-setting',//图标样式class | 57 | iconCls: 'el-icon-setting',//图标样式class |
| 47 | children: [ | 58 | children: [ |
| 48 | { path: '/user', component: User, name: '用户管理' }, | 59 | { path: '/user', component: User, name: '用户管理' }, |
| 49 | - { path: '/role', component: Role, name: '角色管理' }, | 60 | + { path: '/role', component: Role, name: '岗位管理' }, |
| 50 | { path: '/perm', component: Perm, name: '权限管理' }, | 61 | { path: '/perm', component: Perm, name: '权限管理' }, |
| 51 | { path: '/log', component: LOG, name: '系统日志' }, | 62 | { path: '/log', component: LOG, name: '系统日志' }, |
| 63 | + { path: '/department', component: Department, name: '部门管理' }, | ||
| 64 | + { path: '/company', component: Company, name: '公司管理'}, | ||
| 65 | + { path: '/group', component: Group, name: '集团管理'} | ||
| 52 | ] | 66 | ] |
| 53 | }, | 67 | }, |
| 54 | { | 68 | { |
| 55 | - path: '/agent', | 69 | + path: '/guestService', |
| 56 | component: Home, | 70 | component: Home, |
| 57 | - name: '代理人', | 71 | + name: '客服系统', |
| 58 | iconCls: 'fa fa-id-card-o', | 72 | iconCls: 'fa fa-id-card-o', |
| 59 | children: [ | 73 | children: [ |
| 60 | - { path: '/pre', component: PreManifest, name: '预配' }, | ||
| 61 | - { path: '/page5', component: Page5, name: '页面5' } | 74 | + { path: '/process', component: Process, name: '工单管理' }, |
| 75 | + { path: '/job', component: Job, name: '任务管理' } | ||
| 62 | ] | 76 | ] |
| 63 | }, | 77 | }, |
| 64 | { | 78 | { |
| 65 | - path: '/', | 79 | + path: '/empt', |
| 80 | + component: Home, | ||
| 81 | + name: '能源管理', | ||
| 82 | + iconCls: 'fa fa-id-card-o', | ||
| 83 | + children: [ | ||
| 84 | + { path: '/location', component: Location, name: '能源缴费' }, | ||
| 85 | + ] | ||
| 86 | + }, | ||
| 87 | + { | ||
| 88 | + path: '/satff', | ||
| 66 | component: Home, | 89 | component: Home, |
| 67 | - name: '导航二', | 90 | + name: '生活保障部门', |
| 68 | iconCls: 'fa fa-id-card-o', | 91 | iconCls: 'fa fa-id-card-o', |
| 69 | children: [ | 92 | children: [ |
| 70 | - { path: '/page4', component: Page4, name: '页面4' }, | ||
| 71 | - { path: '/page5', component: Page5, name: '页面5' } | 93 | + { path: '/security_inspection', component: SecrityInspection, name: '职工公寓安全巡视管理' }, |
| 94 | + { path: '/key', component: Key, name: '职工公寓备用钥匙使用登记管理' }, | ||
| 95 | + { path: '/maintain', component: Maintain, name: '职工公寓设施设备维修记录管理' }, | ||
| 72 | ] | 96 | ] |
| 73 | }, | 97 | }, |
| 74 | { | 98 | { |
src/utils/companyType.js
100644 → 100755
src/utils/country.js
100644 → 100755
src/utils/customEval.js
0 → 100755
| 1 | +/** | ||
| 2 | +* @Author: jianglei | ||
| 3 | +* @Date: 2017-10-12 12:06:49 | ||
| 4 | +*/ | ||
| 5 | +'use strict' | ||
| 6 | +import Vue from 'vue' | ||
| 7 | +export default function treeToArray(data, expandAll, parent, level, item) { | ||
| 8 | + const marLTemp = [] | ||
| 9 | + let tmp = [] | ||
| 10 | + Array.from(data).forEach(function(record) { | ||
| 11 | + if (record._expanded === undefined) { | ||
| 12 | + Vue.set(record, '_expanded', expandAll) | ||
| 13 | + } | ||
| 14 | + let _level = 1 | ||
| 15 | + if (level !== undefined && level !== null) { | ||
| 16 | + _level = level + 1 | ||
| 17 | + } | ||
| 18 | + Vue.set(record, '_level', _level) | ||
| 19 | + // 如果有父元素 | ||
| 20 | + if (parent) { | ||
| 21 | + Vue.set(record, 'parent', parent) | ||
| 22 | + // 如果父元素有偏移量,需要计算在this的偏移量中 | ||
| 23 | + // 偏移量还与前面同级元素有关,需要加上前面所有元素的长度和 | ||
| 24 | + if (!marLTemp[_level]) { | ||
| 25 | + marLTemp[_level] = 0 | ||
| 26 | + } | ||
| 27 | + Vue.set(record, '_marginLeft', marLTemp[_level] + parent._marginLeft) | ||
| 28 | + Vue.set(record, '_width', record[item] / parent[item] * parent._width) | ||
| 29 | + // 在本次计算过偏移量后加上自己长度,以供下一个元素使用 | ||
| 30 | + marLTemp[_level] += record._width | ||
| 31 | + } else { | ||
| 32 | + // 如果为根 | ||
| 33 | + // 初始化偏移量存储map | ||
| 34 | + marLTemp[record.id] = [] | ||
| 35 | + // map中是一个数组,存储的是每级的长度和 | ||
| 36 | + // 初始情况下为0 | ||
| 37 | + marLTemp[record.id][_level] = 0 | ||
| 38 | + Vue.set(record, '_marginLeft', 0) | ||
| 39 | + Vue.set(record, '_width', 1) | ||
| 40 | + } | ||
| 41 | + tmp.push(record) | ||
| 42 | + if (record.children && record.children.length > 0) { | ||
| 43 | + const children = treeToArray(record.children, expandAll, record, _level, item) | ||
| 44 | + tmp = tmp.concat(children) | ||
| 45 | + } | ||
| 46 | + }) | ||
| 47 | + return tmp | ||
| 48 | +} |
src/utils/dangerGoods.js
100644 → 100755
src/utils/goodsPackage.js
100644 → 100755
src/utils/uld.js
100644 → 100755
| @@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
| 23 | <el-col :span="24" class="main"> | 23 | <el-col :span="24" class="main"> |
| 24 | <aside :class="collapsed?'menu-collapsed':'menu-expanded'"> | 24 | <aside :class="collapsed?'menu-collapsed':'menu-expanded'"> |
| 25 | <!--导航菜单--> | 25 | <!--导航菜单--> |
| 26 | - <el-menu :default-active="$route.path" class="el-menu-vertical-demo" @open="handleopen" @close="handleclose" @select="handleselect" unique-opened router v-show="!collapsed" style="min-width: 230px"> | 26 | + <el-menu :default-active="$route.path" class="el-menu-vertical-demo" @open="handleopen" @close="handleclose" @select="handleselect" unique-opened router v-show="!collapsed" style="min-width: 230px" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b"> |
| 27 | <template v-for="(item,index) in $router.options.routes" v-if="!item.hidden"> | 27 | <template v-for="(item,index) in $router.options.routes" v-if="!item.hidden"> |
| 28 | <el-submenu :index="index+''" v-if="!item.leaf"> | 28 | <el-submenu :index="index+''" v-if="!item.leaf"> |
| 29 | <template slot="title"><i :class="item.iconCls"></i>{{item.name}}</template> | 29 | <template slot="title"><i :class="item.iconCls"></i>{{item.name}}</template> |
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | <li v-for="(item,index) in $router.options.routes" v-if="!item.hidden" class="el-submenu item"> | 37 | <li v-for="(item,index) in $router.options.routes" v-if="!item.hidden" class="el-submenu item"> |
| 38 | <template v-if="!item.leaf"> | 38 | <template v-if="!item.leaf"> |
| 39 | <div class="el-submenu__title" style="padding-left: 20px;" @mouseover="showMenu(index,true)" @mouseout="showMenu(index,false)"><i :class="item.iconCls"></i></div> | 39 | <div class="el-submenu__title" style="padding-left: 20px;" @mouseover="showMenu(index,true)" @mouseout="showMenu(index,false)"><i :class="item.iconCls"></i></div> |
| 40 | - <ul class="el-menu submenu" :class="'submenu-hook-'+index" @mouseover="showMenu(index,true)" @mouseout="showMenu(index,false)"> | 40 | + <ul class="el-menu submenu" :class="'submenu-hook-'+index" @mouseover="showMenu(index,true)" @mouseout="showMenu(index,false)"> |
| 41 | <li v-for="child in item.children" v-if="!child.hidden" :key="child.path" class="el-menu-item" style="padding-left: 40px;" :class="$route.path==child.path?'is-active':''" @click="$router.push(child.path)">{{child.name}}</li> | 41 | <li v-for="child in item.children" v-if="!child.hidden" :key="child.path" class="el-menu-item" style="padding-left: 40px;" :class="$route.path==child.path?'is-active':''" @click="$router.push(child.path)">{{child.name}}</li> |
| 42 | </ul> | 42 | </ul> |
| 43 | </template> | 43 | </template> |
| @@ -70,12 +70,13 @@ | @@ -70,12 +70,13 @@ | ||
| 70 | </el-row> | 70 | </el-row> |
| 71 | </template> | 71 | </template> |
| 72 | 72 | ||
| 73 | + | ||
| 73 | <script> | 74 | <script> |
| 74 | import rt from '../routes' | 75 | import rt from '../routes' |
| 75 | export default { | 76 | export default { |
| 76 | data() { | 77 | data() { |
| 77 | return { | 78 | return { |
| 78 | - sysName:'流浪地球管理系统', | 79 | + sysName:'后勤管理平台', |
| 79 | collapsed:false, | 80 | collapsed:false, |
| 80 | sysUserName: '', | 81 | sysUserName: '', |
| 81 | sysUserAvatar: '', | 82 | sysUserAvatar: '', |
src/views/empt/Location.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <section> | ||
| 3 | + <!--工具条--> | ||
| 4 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
| 5 | + <el-form :inline="true" :model="filters"> | ||
| 6 | + <el-form-item> | ||
| 7 | + <el-input v-model="filters.processName" placeholder="公寓名称"></el-input> | ||
| 8 | + </el-form-item> | ||
| 9 | + <el-form-item> | ||
| 10 | + <el-button type="primary" v-on:click="getList()">查询</el-button> | ||
| 11 | + </el-form-item> | ||
| 12 | + <el-form-item> | ||
| 13 | + <el-button type="primary" @click="handleAdd()">新增</el-button> | ||
| 14 | + </el-form-item> | ||
| 15 | + </el-form> | ||
| 16 | + </el-col> | ||
| 17 | + | ||
| 18 | + <el-table | ||
| 19 | + :data="locationList" | ||
| 20 | + style="width: 100%;margin-bottom: 20px;" | ||
| 21 | + row-key="id" | ||
| 22 | + border | ||
| 23 | + :row-class-name="tableRowClassName" | ||
| 24 | + default-expand-all | ||
| 25 | + :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> | ||
| 26 | + <el-table-column | ||
| 27 | + prop="adrname" | ||
| 28 | + label="名称" | ||
| 29 | + sortable | ||
| 30 | + width="300"> | ||
| 31 | + </el-table-column> | ||
| 32 | + <el-table-column | ||
| 33 | + prop="type" | ||
| 34 | + label="类型" | ||
| 35 | + align="center" | ||
| 36 | + :formatter="formatType" | ||
| 37 | + width="100"> | ||
| 38 | + </el-table-column> | ||
| 39 | + <el-table-column :label="$t('table.actions')" align="center" class-name="small-padding fixed-width"> | ||
| 40 | + <template slot-scope="scope"> | ||
| 41 | + <el-button type="primary" size="small" @click="handleUpdate(scope.row)">快速编辑</el-button> | ||
| 42 | + <el-button type="primary" size="small" @click="handleUpdate(scope.row)">新增</el-button> | ||
| 43 | + <el-button size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">{{ $t('table.delete') }}</el-button> | ||
| 44 | + <el-button type="primary" size="small" @click="electrixityMeterConfiguration(scope.row)">电表参数配置</el-button> | ||
| 45 | + </template> | ||
| 46 | + </el-table-column> | ||
| 47 | + </el-table> | ||
| 48 | + | ||
| 49 | + <!--工具条--> | ||
| 50 | + <el-col :span="24" class="toolbar"> | ||
| 51 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 52 | + <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 53 | + </el-pagination> | ||
| 54 | + </el-col> | ||
| 55 | + | ||
| 56 | + <!--水表新增--> | ||
| 57 | + <el-dialog title="电表参数配置新增" :visible.sync="electrixityAddFormVisible" :close-on-click-modal="false"> | ||
| 58 | + <el-form :model="electrixityAddForm" label-width="110px" :rules="addFormRules" ref="electrixityAddForm"> | ||
| 59 | + <el-form-item label="水电预付费" prop="prepaid"> | ||
| 60 | + <el-switch | ||
| 61 | + v-model="electrixityAddForm.prepaid" | ||
| 62 | + active-color="#00A854" | ||
| 63 | + active-text="是" | ||
| 64 | + active-value="0" | ||
| 65 | + inactive-color="#F04134" | ||
| 66 | + inactive-text="否" | ||
| 67 | + inactive-value="1"> | ||
| 68 | + </el-switch> | ||
| 69 | + </el-form-item> | ||
| 70 | + <el-form-item label="电警告跳闸" prop="warningtrip"> | ||
| 71 | + <el-switch | ||
| 72 | + v-model="electrixityAddForm.warningtrip" | ||
| 73 | + active-color="#00A854" | ||
| 74 | + active-text="是" | ||
| 75 | + active-value="0" | ||
| 76 | + inactive-color="#F04134" | ||
| 77 | + inactive-text="否" | ||
| 78 | + inactive-value="1"> | ||
| 79 | + </el-switch> | ||
| 80 | + <span>告警阀值</span> <el-input v-model="electrixityAddForm.warningthreshold" style="width: 100px;" auto-complete="off"></el-input> <span>元</span> | ||
| 81 | + </el-form-item> | ||
| 82 | + <el-form-item label="透支使能" prop="overdraft"> | ||
| 83 | + <el-switch | ||
| 84 | + v-model="electrixityAddForm.overdraft" | ||
| 85 | + active-color="#00A854" | ||
| 86 | + active-text="是" | ||
| 87 | + active-value="0" | ||
| 88 | + inactive-color="#F04134" | ||
| 89 | + inactive-text="否" | ||
| 90 | + inactive-value="1"> | ||
| 91 | + </el-switch> | ||
| 92 | + <span>可透支额度</span> <el-input v-model="electrixityAddForm.overdraftthreshold" style="width: 100px;" auto-complete="off"></el-input> <span>元</span> | ||
| 93 | + </el-form-item> | ||
| 94 | + <el-form-item label="过负荷跳闸使能" prop="overdraft"> | ||
| 95 | + <el-switch | ||
| 96 | + v-model="electrixityAddForm.load" | ||
| 97 | + active-color="#00A854" | ||
| 98 | + active-text="是" | ||
| 99 | + active-value="0" | ||
| 100 | + inactive-color="#F04134" | ||
| 101 | + inactive-text="否" | ||
| 102 | + inactive-value="1"> | ||
| 103 | + </el-switch> | ||
| 104 | + <span>功率</span> <el-input v-model="electrixityAddForm.power" style="width: 100px;" auto-complete="off"></el-input> <span>KW</span> | ||
| 105 | + <br/> | ||
| 106 | + <br/> | ||
| 107 | + <span>功率因数</span> <el-input v-model="electrixityAddForm.powerfactor" style="width: 100px;" auto-complete="off"></el-input> | ||
| 108 | + </el-form-item> | ||
| 109 | + <el-form-item label="免费电度使能" prop="overdraft"> | ||
| 110 | + <el-switch | ||
| 111 | + v-model="electrixityAddForm.free" | ||
| 112 | + active-color="#00A854" | ||
| 113 | + active-text="是" | ||
| 114 | + active-value="0" | ||
| 115 | + inactive-color="#F04134" | ||
| 116 | + inactive-text="否" | ||
| 117 | + inactive-value="1"> | ||
| 118 | + </el-switch> | ||
| 119 | + <span>免费电度</span> <el-input v-model="electrixityAddForm.overdraftthreshold" style="width: 100px;" auto-complete="off"></el-input> <span>度</span> | ||
| 120 | + </el-form-item> | ||
| 121 | + </el-form> | ||
| 122 | + <div slot="footer" class="dialog-footer"> | ||
| 123 | + <el-button @click.native="electrixityAddFormVisible = false">取消</el-button> | ||
| 124 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 125 | + </div> | ||
| 126 | + </el-dialog> | ||
| 127 | + </section> | ||
| 128 | +</template> | ||
| 129 | +<style> | ||
| 130 | + .el-table .building { | ||
| 131 | + background: oldlace; | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + .el-table .floor { | ||
| 135 | + background: #f0f9eb; | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + .el-table .house { | ||
| 139 | + background: #99CCCC; | ||
| 140 | + } | ||
| 141 | +</style> | ||
| 142 | +<script> | ||
| 143 | + import { getList,add} from '@/api/empt/location_api'; | ||
| 144 | + import moment from 'moment' | ||
| 145 | + import parseTime from '@/utils' | ||
| 146 | + import loginUserInfo from '@/api/base' | ||
| 147 | + | ||
| 148 | + export default { | ||
| 149 | + data() { | ||
| 150 | + return { | ||
| 151 | + filters: { | ||
| 152 | + processName: '', | ||
| 153 | + parseTime: parseTime | ||
| 154 | + }, | ||
| 155 | + userId: '', | ||
| 156 | + realName: '', | ||
| 157 | + wmId:'', | ||
| 158 | + locationList:[], | ||
| 159 | + total: 0, | ||
| 160 | + pageNum: 1, | ||
| 161 | + pageSize: 5, | ||
| 162 | + listLoading: false, | ||
| 163 | + sels: [],//列表选中列 | ||
| 164 | + //编辑界面是否显示 | ||
| 165 | + editFormVisible: false, | ||
| 166 | + editLoading: false, | ||
| 167 | + editFormRules: { | ||
| 168 | + roleName: [ | ||
| 169 | + { required: true, message: '请输入岗位/角色名称', trigger: 'blur' } | ||
| 170 | + ] | ||
| 171 | + }, | ||
| 172 | + //编辑界面数据 | ||
| 173 | + editForm: { | ||
| 174 | + roleId: 1, | ||
| 175 | + description: '', | ||
| 176 | + roleName: '', | ||
| 177 | + roleSign: 1, | ||
| 178 | + departmentId:'' | ||
| 179 | + }, | ||
| 180 | + //用户ID | ||
| 181 | + //新增界面是否显示 | ||
| 182 | + electrixityAddFormVisible: false, | ||
| 183 | + //设置权限界面是否显示 | ||
| 184 | + addLoading: false, | ||
| 185 | + addFormRules: { | ||
| 186 | + roleName: [ | ||
| 187 | + { required: true, message: '请输入岗位/角色名称', trigger: 'blur' } | ||
| 188 | + ], | ||
| 189 | + description: [ | ||
| 190 | + { required: true, message: '请输入岗位/角色描述', trigger: 'blur' } | ||
| 191 | + ] | ||
| 192 | + }, | ||
| 193 | + //水表参数配置、界面数据 | ||
| 194 | + electrixityAddForm: { | ||
| 195 | + prepaid: '', | ||
| 196 | + warningtrip: '', | ||
| 197 | + warningthreshold: '', | ||
| 198 | + overdraft:'', | ||
| 199 | + overdraftthreshold: '', | ||
| 200 | + load: '', | ||
| 201 | + power: '', | ||
| 202 | + powerfactor: '', | ||
| 203 | + freeelectricitylimit: '', | ||
| 204 | + eeId: '' | ||
| 205 | + }, | ||
| 206 | + permForm: { | ||
| 207 | + roleId: 1, | ||
| 208 | + description: '', | ||
| 209 | + roleName: '', | ||
| 210 | + roleSign: 1, | ||
| 211 | + permissions: [] | ||
| 212 | + }, | ||
| 213 | + centerDialogVisible: false, | ||
| 214 | + dialogData:{ | ||
| 215 | + process:{ | ||
| 216 | + processname: '' | ||
| 217 | + } | ||
| 218 | + }, | ||
| 219 | + pickerOptions: { | ||
| 220 | + disabledDate(time) { | ||
| 221 | + return time.getTime() < Date.now(); | ||
| 222 | + }, | ||
| 223 | + shortcuts: [{ | ||
| 224 | + text: '今天', | ||
| 225 | + onClick(picker) { | ||
| 226 | + picker.$emit('pick', new Date()); | ||
| 227 | + } | ||
| 228 | + }, { | ||
| 229 | + text: '昨天', | ||
| 230 | + onClick(picker) { | ||
| 231 | + const date = new Date(); | ||
| 232 | + date.setTime(date.getTime() - 3600 * 1000 * 24); | ||
| 233 | + picker.$emit('pick', date); | ||
| 234 | + } | ||
| 235 | + }, { | ||
| 236 | + text: '一周前', | ||
| 237 | + onClick(picker) { | ||
| 238 | + const date = new Date(); | ||
| 239 | + date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); | ||
| 240 | + picker.$emit('pick', date); | ||
| 241 | + } | ||
| 242 | + }] | ||
| 243 | + }, | ||
| 244 | + options:[{ | ||
| 245 | + value: '1', | ||
| 246 | + label: '测试公司', | ||
| 247 | + children: [{ | ||
| 248 | + value: '2', | ||
| 249 | + label: '测试部门一', | ||
| 250 | + children: [{ | ||
| 251 | + value: '1', | ||
| 252 | + label: '测试岗位1', | ||
| 253 | + children: [{ | ||
| 254 | + value: '1', | ||
| 255 | + label: '测试人员1' | ||
| 256 | + }] | ||
| 257 | + }] | ||
| 258 | + }, { | ||
| 259 | + value: '3', | ||
| 260 | + label: '测试部门二', | ||
| 261 | + children: [{ | ||
| 262 | + value: '2', | ||
| 263 | + label: '测试岗位2', | ||
| 264 | + children: [{ | ||
| 265 | + value: '1', | ||
| 266 | + label: '测试人员2' | ||
| 267 | + }] | ||
| 268 | + }, { | ||
| 269 | + value: '3', | ||
| 270 | + label: '测试岗位3', | ||
| 271 | + children: [{ | ||
| 272 | + value: '1', | ||
| 273 | + label: '测试人员3' | ||
| 274 | + }] | ||
| 275 | + }] | ||
| 276 | + }] | ||
| 277 | + }], | ||
| 278 | + } | ||
| 279 | + }, | ||
| 280 | + methods: { | ||
| 281 | + //性别显示转换 | ||
| 282 | + formatType: function (row, column) { | ||
| 283 | + let msg = '未知'; | ||
| 284 | + switch (row.type){ | ||
| 285 | + case 0: | ||
| 286 | + msg='公寓'; | ||
| 287 | + break; | ||
| 288 | + case 1: | ||
| 289 | + msg='楼'; | ||
| 290 | + break; | ||
| 291 | + case 2: | ||
| 292 | + msg='层'; | ||
| 293 | + break; | ||
| 294 | + case 3: | ||
| 295 | + msg='门牌'; | ||
| 296 | + break; | ||
| 297 | + } | ||
| 298 | + return msg; | ||
| 299 | + }, | ||
| 300 | + handleCurrentChange(val) { | ||
| 301 | + this.pageNum = val; | ||
| 302 | + }, | ||
| 303 | + //获取列表 | ||
| 304 | + getList() { | ||
| 305 | + let para = { | ||
| 306 | + pageNum: this.pageNum, | ||
| 307 | + pageSize: this.pageSize, | ||
| 308 | + }; | ||
| 309 | + this.listLoading = true; | ||
| 310 | + //NProgress.start(); | ||
| 311 | + getList(para).then((res) => { | ||
| 312 | + let resData = res.data.data; | ||
| 313 | + this.total = resData.total; | ||
| 314 | + this.locationList = resData.list; | ||
| 315 | + this.listLoading = false; | ||
| 316 | + //NProgress.done(); | ||
| 317 | + }).catch((error) => { | ||
| 318 | + this.listLoading = false; | ||
| 319 | + if(null!= error.response && error.response!==undefined){ | ||
| 320 | + let status= error.response.status; | ||
| 321 | + let msg = error.response.statusText; | ||
| 322 | + alert(status+msg); | ||
| 323 | + }else { | ||
| 324 | + alert(error); | ||
| 325 | + } | ||
| 326 | + | ||
| 327 | + }); | ||
| 328 | + | ||
| 329 | + }, | ||
| 330 | + //删除 | ||
| 331 | + handleDel: function (index, row) { | ||
| 332 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 333 | + type: 'warning' | ||
| 334 | + }).then(() => { | ||
| 335 | + this.listLoading = true; | ||
| 336 | + //NProgress.start(); | ||
| 337 | + let para = { roleId: row.roleId }; | ||
| 338 | + remove(para).then((res) => { | ||
| 339 | + this.listLoading = false; | ||
| 340 | + //NProgress.done(); | ||
| 341 | + this.$message({ | ||
| 342 | + message: '删除成功', | ||
| 343 | + type: 'success' | ||
| 344 | + }); | ||
| 345 | + }).catch((error) => { | ||
| 346 | + this.listLoading = false; | ||
| 347 | + alert(error); | ||
| 348 | + }); | ||
| 349 | + }).catch(); | ||
| 350 | + }, | ||
| 351 | + /** | ||
| 352 | + * 显示编辑界面 | ||
| 353 | + * @param index | ||
| 354 | + * @param row 为这行的数据对象 | ||
| 355 | + */ | ||
| 356 | + handleEdit: function (index, row) { | ||
| 357 | + this.editFormVisible = true; | ||
| 358 | + this.editForm = Object.assign({}, row); | ||
| 359 | + this.getdepartmentNames(); | ||
| 360 | + }, | ||
| 361 | + //水表参数配置新增界面,每次点开初始化数据 | ||
| 362 | + electrixityMeterConfiguration: function (row) { | ||
| 363 | + this.electrixityAddFormVisible = true; | ||
| 364 | + this.electrixityAddForm = { | ||
| 365 | + prepaid: '', | ||
| 366 | + warningtrip: '', | ||
| 367 | + warningthreshold: '', | ||
| 368 | + overdraft:'', | ||
| 369 | + overdraftthreshold: '', | ||
| 370 | + load: '', | ||
| 371 | + water: '', | ||
| 372 | + free: '', | ||
| 373 | + freeWater: '', | ||
| 374 | + eeId: row.eeId | ||
| 375 | + } | ||
| 376 | + }, | ||
| 377 | + | ||
| 378 | + //新增 | ||
| 379 | + addSubmit: function () { | ||
| 380 | + this.$refs.electrixityAddForm.validate((valid) => { | ||
| 381 | + if (valid) { | ||
| 382 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 383 | + this.addLoading = true; | ||
| 384 | + //NProgress.start(); | ||
| 385 | + let para = Object.assign({}, this.electrixityAddForm); | ||
| 386 | + add(para).then((res) => { | ||
| 387 | + this.addLoading = false; | ||
| 388 | + if (res.status ===200) { | ||
| 389 | + this.$message({ | ||
| 390 | + message: '提交成功', | ||
| 391 | + type: 'success' | ||
| 392 | + }); | ||
| 393 | + this.$refs['permForm'].resetFields(); | ||
| 394 | + this.electrixityAddFormVisible = false; | ||
| 395 | + this.getList(); | ||
| 396 | + } | ||
| 397 | + }).catch(error => alert(error)); | ||
| 398 | + }); | ||
| 399 | + } | ||
| 400 | + }); | ||
| 401 | + }, | ||
| 402 | + | ||
| 403 | + //编辑 | ||
| 404 | + editSubmit: function () { | ||
| 405 | + this.$refs.editForm.validate((valid) => { | ||
| 406 | + if (valid) { | ||
| 407 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 408 | + this.editLoading = true; | ||
| 409 | + //NProgress.start(); | ||
| 410 | + let para = Object.assign({}, this.editForm); | ||
| 411 | + //不需要提交的 去掉,后端不好接收 | ||
| 412 | + para.authorities = null; | ||
| 413 | + para.permissions = null; | ||
| 414 | + para.roles = null; | ||
| 415 | +// para.birth = (!para.birth || para.birth == '') ? '' : util.formatDate.format(new Date(para.birth), 'yyyy-MM-dd'); | ||
| 416 | + /* | ||
| 417 | + 查询之后格式this.filters.column.create_start_date中日期发生变化; | ||
| 418 | + Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) 变成了 "2017-08-08T16:00:00.000Z"; | ||
| 419 | + 所以使用 moment 日期格式化插件将时间转换成 [ Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) ] 格 | ||
| 420 | + 式; | ||
| 421 | + */ | ||
| 422 | + /*moment 安装 npm install moment --save*/ | ||
| 423 | + para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss'); | ||
| 424 | + this.editLoading = false; | ||
| 425 | + edit(para).then((res) => { | ||
| 426 | + | ||
| 427 | + //NProgress.done(); | ||
| 428 | + this.$message({ | ||
| 429 | + message: '提交成功', | ||
| 430 | + type: 'success' | ||
| 431 | + }); | ||
| 432 | + this.$refs['editForm'].resetFields(); | ||
| 433 | + this.editFormVisible = false; | ||
| 434 | + }).catch(error => alert(error)); | ||
| 435 | + }); | ||
| 436 | + } | ||
| 437 | + }); | ||
| 438 | + }, | ||
| 439 | + selsChange: function (sels) { | ||
| 440 | + this.sels = sels; | ||
| 441 | + }, | ||
| 442 | + //批量删除 | ||
| 443 | + batchRemove: function () { | ||
| 444 | + var ids = this.sels.map(item => item.roleId).toString(); | ||
| 445 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 446 | + type: 'warning' | ||
| 447 | + }).then(() => { | ||
| 448 | + this.listLoading = true; | ||
| 449 | + //NProgress.start(); | ||
| 450 | + let para = { ids: ids }; | ||
| 451 | + batchRemove(para).then((res) => { | ||
| 452 | + this.listLoading = false; | ||
| 453 | + //NProgress.done(); | ||
| 454 | + this.$message({ | ||
| 455 | + message: '删除成功', | ||
| 456 | + type: 'success' | ||
| 457 | + }) | ||
| 458 | + }); | ||
| 459 | + }).catch(() => { | ||
| 460 | + | ||
| 461 | + }); | ||
| 462 | + }, | ||
| 463 | + tableRowClassName({row, rowIndex}) { | ||
| 464 | + let type = row.type; | ||
| 465 | + if (type === 1) { | ||
| 466 | + return 'building'; | ||
| 467 | + } else if (type === 2) { | ||
| 468 | + return 'floor'; | ||
| 469 | + } else if (type === 3){ | ||
| 470 | + return 'house'; | ||
| 471 | + } | ||
| 472 | + return ''; | ||
| 473 | + }, | ||
| 474 | + handleSelectionChange(val) { | ||
| 475 | + this.multipleSelection = val | ||
| 476 | + }, | ||
| 477 | + }, | ||
| 478 | + mounted() { | ||
| 479 | + this.userId = loginUserInfo.userId; | ||
| 480 | + this.realName = loginUserInfo.realname; | ||
| 481 | + this.getList(); | ||
| 482 | + } | ||
| 483 | + } | ||
| 484 | + | ||
| 485 | +</script> | ||
| 486 | + | ||
| 487 | +<style scoped> | ||
| 488 | + | ||
| 489 | +</style> |
src/views/hqpt/Job.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <section> | ||
| 3 | + <el-dialog | ||
| 4 | + :data="dialogData" | ||
| 5 | + title="执行过程" | ||
| 6 | + :visible.sync="centerDialogVisible" | ||
| 7 | + width="30%" | ||
| 8 | + center> | ||
| 9 | + <span>{{dialogData.process.processname}}</span> | ||
| 10 | + <span>{{dialogData.coment}}</span> | ||
| 11 | + <span slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="centerDialogVisible = false">取 消</el-button> | ||
| 13 | + <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button> | ||
| 14 | + </span> | ||
| 15 | + </el-dialog> | ||
| 16 | + <!--工具条--> | ||
| 17 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
| 18 | + <el-form :inline="true" :model="filters"> | ||
| 19 | + <el-form-item> | ||
| 20 | + <el-input v-model="filters.processName" placeholder="工单名称"></el-input> | ||
| 21 | + </el-form-item> | ||
| 22 | + <el-form-item> | ||
| 23 | + <el-button type="primary" v-on:click="getProcessList()">查询</el-button> | ||
| 24 | + </el-form-item> | ||
| 25 | + <el-form-item> | ||
| 26 | + <el-button type="primary" @click="handleAdd()">新增</el-button> | ||
| 27 | + </el-form-item> | ||
| 28 | + </el-form> | ||
| 29 | + </el-col> | ||
| 30 | + | ||
| 31 | + <!--列表--> | ||
| 32 | + <el-table :data="processList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;"> | ||
| 33 | + <el-table-column type="selection" width="55"> | ||
| 34 | + </el-table-column> | ||
| 35 | + <el-table-column type="index" width="60"> | ||
| 36 | + </el-table-column> | ||
| 37 | + <el-table-column prop="process.processname" label="工单名称" width="100"> | ||
| 38 | + </el-table-column> | ||
| 39 | + <el-table-column prop="user.realname" label="执行者" min-width="100" sortable> | ||
| 40 | + </el-table-column> | ||
| 41 | + <el-table-column prop="auditresuld" label="执行状态" min-width="80" :formatter="formatType" sortable> | ||
| 42 | + </el-table-column> | ||
| 43 | + <el-table-column label="操作" min-width="260"> | ||
| 44 | + <template slot-scope="scope"> | ||
| 45 | + <el-button size="small" @click="startJob(scope.$index, scope.row)">开始执行</el-button> | ||
| 46 | + <el-button size="small" @click="setPerm(scope.$index, scope.row)">完成任务</el-button> | ||
| 47 | + <el-button size="small" @click="setPerm(scope.$index, scope.row)">任务转交</el-button> | ||
| 48 | + <el-button size="small" @click="shwoDialog(scope.$index, scope.row)">任务内容</el-button> | ||
| 49 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 50 | + </template> | ||
| 51 | + </el-table-column> | ||
| 52 | + </el-table> | ||
| 53 | + | ||
| 54 | + <!--工具条--> | ||
| 55 | + <el-col :span="24" class="toolbar"> | ||
| 56 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 57 | + <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 58 | + </el-pagination> | ||
| 59 | + </el-col> | ||
| 60 | + | ||
| 61 | + <!--编辑界面--> | ||
| 62 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 63 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 64 | + <el-form-item label="ID"> | ||
| 65 | + <span>{{editForm.roleId}}</span> | ||
| 66 | + </el-form-item> | ||
| 67 | + <el-form-item label="岗位名称"> | ||
| 68 | + <el-input v-model="editForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input> | ||
| 69 | + </el-form-item> | ||
| 70 | + <el-form-item label="岗位描述"> | ||
| 71 | + <el-input v-model="editForm.description" auto-complete="off" placeholder="请输入岗位/角色描述:例如:用户管理员"></el-input> | ||
| 72 | + </el-form-item> | ||
| 73 | + <el-form-item label="部门名称"> | ||
| 74 | + <el-select v-model="editForm.departmentId" placeholder="请选择"> | ||
| 75 | + <el-option | ||
| 76 | + v-for="item in departmentNameList" | ||
| 77 | + :key="item.departmentId" | ||
| 78 | + :label="item.departmentName" | ||
| 79 | + :value="item.departmentId"> | ||
| 80 | + </el-option> | ||
| 81 | + </el-select> | ||
| 82 | + </el-form-item> | ||
| 83 | + </el-form> | ||
| 84 | + <div slot="footer" class="dialog-footer"> | ||
| 85 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 86 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
| 87 | + </div> | ||
| 88 | + </el-dialog> | ||
| 89 | + | ||
| 90 | + <!--新增界面--> | ||
| 91 | + <el-dialog title="新增" :visible.sync="addFormVisible" width="60%"> | ||
| 92 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 93 | + <el-form-item label="工单名称" prop="processname"> | ||
| 94 | + <el-input v-model="addForm.processname" auto-complete="off" placeholder="请输入工单标题:"></el-input> | ||
| 95 | + </el-form-item> | ||
| 96 | + <el-form-item label="开始日期" prop="begindate"> | ||
| 97 | + <el-date-picker :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择时间" v-model="addForm.begindate" style="width: 100%;"></el-date-picker> | ||
| 98 | + </el-form-item> | ||
| 99 | + <el-form-item label="结束日期" prop="enddate"> | ||
| 100 | + <el-date-picker :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择时间" v-model="addForm.enddate" style="width: 100%;"></el-date-picker> | ||
| 101 | + </el-form-item> | ||
| 102 | + <el-form-item label="工单类型" prop="vacationtype"> | ||
| 103 | + <el-select v-model="addForm.vacationtype" placeholder="请选择"> | ||
| 104 | + <el-option label="运维检查" value="0"></el-option> | ||
| 105 | + <el-option label="设备故障" value="1"></el-option> | ||
| 106 | + <el-option label="电话报修" value="3"></el-option> | ||
| 107 | + </el-select> | ||
| 108 | + </el-form-item> | ||
| 109 | + <el-form-item label="工单内容" prop="reason"> | ||
| 110 | + <el-input type="textarea" v-model="addForm.reason"></el-input> | ||
| 111 | + </el-form-item> | ||
| 112 | + <el-form-item> | ||
| 113 | + <el-cascader-panel | ||
| 114 | + :options="options" | ||
| 115 | + v-model="jodUserId" | ||
| 116 | + @change="cascaderhandleChange" | ||
| 117 | + ></el-cascader-panel> | ||
| 118 | + </el-form-item> | ||
| 119 | + </el-form> | ||
| 120 | + <div slot="footer" class="dialog-footer"> | ||
| 121 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 122 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 123 | + </div> | ||
| 124 | + </el-dialog> | ||
| 125 | + </section> | ||
| 126 | +</template> | ||
| 127 | + | ||
| 128 | +<script> | ||
| 129 | + import util from '../../common/js/util' | ||
| 130 | + import { getList,add,startJob} from '@/api/job_api'; | ||
| 131 | + import moment from 'moment' | ||
| 132 | + import parseTime from '@/utils' | ||
| 133 | + import loginUserInfo from '@/api/base' | ||
| 134 | + import ElFormItem from "../../../node_modules/element-ui/packages/form/src/form-item.vue"; | ||
| 135 | + export default { | ||
| 136 | + components: {ElFormItem}, | ||
| 137 | + data() { | ||
| 138 | + return { | ||
| 139 | + filters: { | ||
| 140 | + processName: '', | ||
| 141 | + parseTime: parseTime | ||
| 142 | + }, | ||
| 143 | + departmentNameList:[], | ||
| 144 | + processList: [], | ||
| 145 | + permissons: [], | ||
| 146 | + permIds: [], | ||
| 147 | + total: 0, | ||
| 148 | + pageNum: 1, | ||
| 149 | + pageSize: 5, | ||
| 150 | + listLoading: false, | ||
| 151 | + sels: [],//列表选中列 | ||
| 152 | + //编辑界面是否显示 | ||
| 153 | + editFormVisible: false, | ||
| 154 | + editLoading: false, | ||
| 155 | + editFormRules: { | ||
| 156 | + roleName: [ | ||
| 157 | + { required: true, message: '请输入岗位/角色名称', trigger: 'blur' } | ||
| 158 | + ] | ||
| 159 | + }, | ||
| 160 | + //编辑界面数据 | ||
| 161 | + editForm: { | ||
| 162 | + roleId: 1, | ||
| 163 | + description: '', | ||
| 164 | + roleName: '', | ||
| 165 | + roleSign: 1, | ||
| 166 | + departmentId:'' | ||
| 167 | + }, | ||
| 168 | + //用户ID | ||
| 169 | + | ||
| 170 | + //执行任务人ID | ||
| 171 | + jodUserId: 0, | ||
| 172 | + //新增界面是否显示 | ||
| 173 | + addFormVisible: false, | ||
| 174 | + //设置权限界面是否显示 | ||
| 175 | + PermFormVisible: false, | ||
| 176 | + addLoading: false, | ||
| 177 | + addFormRules: { | ||
| 178 | + roleName: [ | ||
| 179 | + { required: true, message: '请输入岗位/角色名称', trigger: 'blur' } | ||
| 180 | + ], | ||
| 181 | + description: [ | ||
| 182 | + { required: true, message: '请输入岗位/角色描述', trigger: 'blur' } | ||
| 183 | + ] | ||
| 184 | + }, | ||
| 185 | + //新增界面数据 | ||
| 186 | + addForm: { | ||
| 187 | + processname: '', | ||
| 188 | + begindate: '', | ||
| 189 | + enddate: '', | ||
| 190 | + vacationtype:'', | ||
| 191 | + reason: '', | ||
| 192 | + userId: '' | ||
| 193 | + }, | ||
| 194 | + permForm: { | ||
| 195 | + roleId: 1, | ||
| 196 | + description: '', | ||
| 197 | + roleName: '', | ||
| 198 | + roleSign: 1, | ||
| 199 | + permissions: [] | ||
| 200 | + }, | ||
| 201 | + centerDialogVisible: false, | ||
| 202 | + dialogData:{ | ||
| 203 | + process:{ | ||
| 204 | + processname: '' | ||
| 205 | + } | ||
| 206 | + }, | ||
| 207 | + pickerOptions: { | ||
| 208 | + disabledDate(time) { | ||
| 209 | + return time.getTime() < Date.now(); | ||
| 210 | + }, | ||
| 211 | + shortcuts: [{ | ||
| 212 | + text: '今天', | ||
| 213 | + onClick(picker) { | ||
| 214 | + picker.$emit('pick', new Date()); | ||
| 215 | + } | ||
| 216 | + }, { | ||
| 217 | + text: '昨天', | ||
| 218 | + onClick(picker) { | ||
| 219 | + const date = new Date(); | ||
| 220 | + date.setTime(date.getTime() - 3600 * 1000 * 24); | ||
| 221 | + picker.$emit('pick', date); | ||
| 222 | + } | ||
| 223 | + }, { | ||
| 224 | + text: '一周前', | ||
| 225 | + onClick(picker) { | ||
| 226 | + const date = new Date(); | ||
| 227 | + date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); | ||
| 228 | + picker.$emit('pick', date); | ||
| 229 | + } | ||
| 230 | + }] | ||
| 231 | + }, | ||
| 232 | + options:[{ | ||
| 233 | + value: '1', | ||
| 234 | + label: '测试公司', | ||
| 235 | + children: [{ | ||
| 236 | + value: '2', | ||
| 237 | + label: '测试部门一', | ||
| 238 | + children: [{ | ||
| 239 | + value: '1', | ||
| 240 | + label: '测试岗位1', | ||
| 241 | + children: [{ | ||
| 242 | + value: '1', | ||
| 243 | + label: '测试人员1' | ||
| 244 | + }] | ||
| 245 | + }] | ||
| 246 | + }, { | ||
| 247 | + value: '3', | ||
| 248 | + label: '测试部门二', | ||
| 249 | + children: [{ | ||
| 250 | + value: '2', | ||
| 251 | + label: '测试岗位2', | ||
| 252 | + children: [{ | ||
| 253 | + value: '1', | ||
| 254 | + label: '测试人员2' | ||
| 255 | + }] | ||
| 256 | + }, { | ||
| 257 | + value: '3', | ||
| 258 | + label: '测试岗位3', | ||
| 259 | + children: [{ | ||
| 260 | + value: '1', | ||
| 261 | + label: '测试人员3' | ||
| 262 | + }] | ||
| 263 | + }] | ||
| 264 | + }] | ||
| 265 | + }], | ||
| 266 | + } | ||
| 267 | + }, | ||
| 268 | + methods: { | ||
| 269 | + //性别显示转换 | ||
| 270 | + formatType: function (row, column) { | ||
| 271 | + let msg = '未知'; | ||
| 272 | + switch (row.auditresuld){ | ||
| 273 | + case 0: | ||
| 274 | + msg='未执行'; | ||
| 275 | + break; | ||
| 276 | + case 1: | ||
| 277 | + msg='执行中'; | ||
| 278 | + break; | ||
| 279 | + case 2: | ||
| 280 | + msg='执行完毕'; | ||
| 281 | + break; | ||
| 282 | + case 3: | ||
| 283 | + msg='任务转交'; | ||
| 284 | + break; | ||
| 285 | + } | ||
| 286 | + return msg; | ||
| 287 | + }, | ||
| 288 | + formatState: function (row, column) { | ||
| 289 | + let msg = '未知'; | ||
| 290 | + switch (row.processstatus){ | ||
| 291 | + case 0: | ||
| 292 | + msg='未分配'; | ||
| 293 | + break; | ||
| 294 | + case 1: | ||
| 295 | + msg='已分配'; | ||
| 296 | + break; | ||
| 297 | + case 2: | ||
| 298 | + msg='执行中'; | ||
| 299 | + break; | ||
| 300 | + case 3: | ||
| 301 | + msg='已完成'; | ||
| 302 | + break; | ||
| 303 | + } | ||
| 304 | + return msg; | ||
| 305 | + }, | ||
| 306 | + handleCurrentChange(val) { | ||
| 307 | + this.pageNum = val; | ||
| 308 | + }, | ||
| 309 | + //获取工单列表 | ||
| 310 | + getProcessList() { | ||
| 311 | + let para = { | ||
| 312 | + pageNum: this.pageNum, | ||
| 313 | + pageSize: this.pageSize, | ||
| 314 | + userId: 0, | ||
| 315 | + processid: this.$route.params.formid | ||
| 316 | + }; | ||
| 317 | + this.listLoading = true; | ||
| 318 | + //NProgress.start(); | ||
| 319 | + getList(para).then((res) => { | ||
| 320 | + let resData = res.data.data; | ||
| 321 | + this.total = resData.total; | ||
| 322 | + this.processList = resData.list; | ||
| 323 | + this.listLoading = false; | ||
| 324 | + //NProgress.done(); | ||
| 325 | + }).catch((error) => { | ||
| 326 | + this.listLoading = false; | ||
| 327 | + if(null!= error.response && error.response!==undefined){ | ||
| 328 | + let status= error.response.status; | ||
| 329 | + let msg = error.response.statusText; | ||
| 330 | + alert(status+msg); | ||
| 331 | + }else { | ||
| 332 | + alert(error); | ||
| 333 | + } | ||
| 334 | + | ||
| 335 | + }); | ||
| 336 | + | ||
| 337 | + }, | ||
| 338 | + //删除 | ||
| 339 | + handleDel: function (index, row) { | ||
| 340 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 341 | + type: 'warning' | ||
| 342 | + }).then(() => { | ||
| 343 | + this.listLoading = true; | ||
| 344 | + //NProgress.start(); | ||
| 345 | + let para = { roleId: row.roleId }; | ||
| 346 | + remove(para).then((res) => { | ||
| 347 | + this.listLoading = false; | ||
| 348 | + //NProgress.done(); | ||
| 349 | + this.$message({ | ||
| 350 | + message: '删除成功', | ||
| 351 | + type: 'success' | ||
| 352 | + }); | ||
| 353 | + }).catch((error) => { | ||
| 354 | + this.listLoading = false; | ||
| 355 | + alert(error); | ||
| 356 | + }); | ||
| 357 | + }).catch(); | ||
| 358 | + }, | ||
| 359 | + /** | ||
| 360 | + * 显示编辑界面 | ||
| 361 | + * @param index | ||
| 362 | + * @param row 为这行的数据对象 | ||
| 363 | + */ | ||
| 364 | + handleEdit: function (index, row) { | ||
| 365 | + this.editFormVisible = true; | ||
| 366 | + this.editForm = Object.assign({}, row); | ||
| 367 | + this.getdepartmentNames(); | ||
| 368 | + }, | ||
| 369 | + //显示新增界面,每次点开初始化数据 | ||
| 370 | + handleAdd: function () { | ||
| 371 | + this.addFormVisible = true; | ||
| 372 | + this.addForm = { | ||
| 373 | + processname: '', | ||
| 374 | + begindate: '', | ||
| 375 | + enddate: '', | ||
| 376 | + vacationtype:'', | ||
| 377 | + reason: '', | ||
| 378 | + userid: loginUserInfo.userId | ||
| 379 | + } | ||
| 380 | + }, | ||
| 381 | + //编辑 | ||
| 382 | + editSubmit: function () { | ||
| 383 | + this.$refs.editForm.validate((valid) => { | ||
| 384 | + if (valid) { | ||
| 385 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 386 | + this.editLoading = true; | ||
| 387 | + //NProgress.start(); | ||
| 388 | + let para = Object.assign({}, this.editForm); | ||
| 389 | + //不需要提交的 去掉,后端不好接收 | ||
| 390 | + para.authorities = null; | ||
| 391 | + para.permissions = null; | ||
| 392 | + para.roles = null; | ||
| 393 | +// para.birth = (!para.birth || para.birth == '') ? '' : util.formatDate.format(new Date(para.birth), 'yyyy-MM-dd'); | ||
| 394 | + /* | ||
| 395 | + 查询之后格式this.filters.column.create_start_date中日期发生变化; | ||
| 396 | + Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) 变成了 "2017-08-08T16:00:00.000Z"; | ||
| 397 | + 所以使用 moment 日期格式化插件将时间转换成 [ Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) ] 格 | ||
| 398 | + 式; | ||
| 399 | + */ | ||
| 400 | + /*moment 安装 npm install moment --save*/ | ||
| 401 | + para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss'); | ||
| 402 | + this.editLoading = false; | ||
| 403 | + edit(para).then((res) => { | ||
| 404 | + | ||
| 405 | + //NProgress.done(); | ||
| 406 | + this.$message({ | ||
| 407 | + message: '提交成功', | ||
| 408 | + type: 'success' | ||
| 409 | + }); | ||
| 410 | + this.$refs['editForm'].resetFields(); | ||
| 411 | + this.editFormVisible = false; | ||
| 412 | + }).catch(error => alert(error)); | ||
| 413 | + }); | ||
| 414 | + } | ||
| 415 | + }); | ||
| 416 | + }, | ||
| 417 | + //新增 | ||
| 418 | + addSubmit: function () { | ||
| 419 | + this.$refs.addForm.validate((valid) => { | ||
| 420 | + if (valid) { | ||
| 421 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 422 | + this.addLoading = true; | ||
| 423 | + //NProgress.start(); | ||
| 424 | + let para = Object.assign({}, this.addForm); | ||
| 425 | + add(para).then((res) => { | ||
| 426 | + this.addLoading = false; | ||
| 427 | + if (res.status ===200) { | ||
| 428 | + this.$message({ | ||
| 429 | + message: '提交成功', | ||
| 430 | + type: 'success' | ||
| 431 | + }); | ||
| 432 | + this.$refs['permForm'].resetFields(); | ||
| 433 | + this.addFormVisible = false; | ||
| 434 | + this.getProcessList(); | ||
| 435 | + } | ||
| 436 | + }).catch(error => alert(error)); | ||
| 437 | + }); | ||
| 438 | + } | ||
| 439 | + }); | ||
| 440 | + }, | ||
| 441 | + startJob: function (index, row) { | ||
| 442 | + let loading = this.$loading({ fullscreen: true, | ||
| 443 | + background: 'gray', | ||
| 444 | + text: '正在处理'}); | ||
| 445 | + let jobdata = Object.assign({}, row); | ||
| 446 | + startJob(jobdata).then((res) => { | ||
| 447 | + if (res.status ===200) { | ||
| 448 | + this.getProcessList(); | ||
| 449 | + this.listLoading = false; | ||
| 450 | + this.$message({ | ||
| 451 | + message: '提交成功', | ||
| 452 | + type: 'success' | ||
| 453 | + }); | ||
| 454 | + } | ||
| 455 | + }).catch(error => alert(error)); | ||
| 456 | + loading.close(); | ||
| 457 | + }, | ||
| 458 | + selsChange: function (sels) { | ||
| 459 | + this.sels = sels; | ||
| 460 | + }, | ||
| 461 | + //批量删除 | ||
| 462 | + batchRemove: function () { | ||
| 463 | + var ids = this.sels.map(item => item.roleId).toString(); | ||
| 464 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 465 | + type: 'warning' | ||
| 466 | + }).then(() => { | ||
| 467 | + this.listLoading = true; | ||
| 468 | + //NProgress.start(); | ||
| 469 | + let para = { ids: ids }; | ||
| 470 | + batchRemove(para).then((res) => { | ||
| 471 | + this.listLoading = false; | ||
| 472 | + //NProgress.done(); | ||
| 473 | + this.$message({ | ||
| 474 | + message: '删除成功', | ||
| 475 | + type: 'success' | ||
| 476 | + }) | ||
| 477 | + }); | ||
| 478 | + }).catch(() => { | ||
| 479 | + | ||
| 480 | + }); | ||
| 481 | + }, | ||
| 482 | + shwoDialog(index,row) { | ||
| 483 | + this.dialogData = Object.assign({}, row); | ||
| 484 | + this.centerDialogVisible = true; | ||
| 485 | + }, | ||
| 486 | + cascaderhandleChange:function (value) { | ||
| 487 | + let defaultvalue = ["0","0","0","0"]; | ||
| 488 | + defaultvalue = value; | ||
| 489 | + console.log(defaultvalue); | ||
| 490 | + this.jodUserId = defaultvalue[3]; | ||
| 491 | + } | ||
| 492 | + }, | ||
| 493 | + mounted() { | ||
| 494 | + this.getProcessList(); | ||
| 495 | + } | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | +</script> | ||
| 499 | + | ||
| 500 | +<style scoped> | ||
| 501 | + | ||
| 502 | +</style> |
src/views/hqpt/Process.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <section> | ||
| 3 | + <el-dialog | ||
| 4 | + :data="dialogData" | ||
| 5 | + title="提示" | ||
| 6 | + :visible.sync="centerDialogVisible" | ||
| 7 | + width="30%" | ||
| 8 | + center> | ||
| 9 | + <span>{{dialogData.reason}}</span> | ||
| 10 | + <span slot="footer" class="dialog-footer"> | ||
| 11 | + <el-button @click="centerDialogVisible = false">取 消</el-button> | ||
| 12 | + <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button> | ||
| 13 | + </span> | ||
| 14 | + </el-dialog> | ||
| 15 | + <!--工具条--> | ||
| 16 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
| 17 | + <el-form :inline="true" :model="filters"> | ||
| 18 | + <el-form-item> | ||
| 19 | + <el-input v-model="filters.processName" placeholder="工单名称"></el-input> | ||
| 20 | + </el-form-item> | ||
| 21 | + <el-form-item> | ||
| 22 | + <el-button type="primary" v-on:click="getProcessList()">查询</el-button> | ||
| 23 | + </el-form-item> | ||
| 24 | + <el-form-item> | ||
| 25 | + <el-button type="primary" @click="handleAdd()">新增</el-button> | ||
| 26 | + </el-form-item> | ||
| 27 | + </el-form> | ||
| 28 | + </el-col> | ||
| 29 | + | ||
| 30 | + <!--列表--> | ||
| 31 | + <el-table :data="processList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;"> | ||
| 32 | + <el-table-column type="selection" width="55"> | ||
| 33 | + </el-table-column> | ||
| 34 | + <el-table-column type="index" width="60"> | ||
| 35 | + </el-table-column> | ||
| 36 | + <el-table-column prop="processname" label="工单名称" width="100"> | ||
| 37 | + <template slot-scope="scope"> | ||
| 38 | + <el-button size="small" type="text" @click="checkJobs(scope.$index, scope.row)">{{scope.row.processname}}</el-button> | ||
| 39 | + </template> | ||
| 40 | + </el-table-column> | ||
| 41 | + <el-table-column prop="user.realname" label="添加者" min-width="100" sortable> | ||
| 42 | + </el-table-column> | ||
| 43 | + <el-table-column label="开始日期" width="200px" align="center" sortable> | ||
| 44 | + <template slot-scope="scope"> | ||
| 45 | + <span>{{ scope.row.begindate}}</span> | ||
| 46 | + </template> | ||
| 47 | + </el-table-column> | ||
| 48 | + <el-table-column label="结束日期" width="200px" align="center" sortable> | ||
| 49 | + <template slot-scope="scope"> | ||
| 50 | + <span>{{ scope.row.enddate}}</span> | ||
| 51 | + </template> | ||
| 52 | + </el-table-column> | ||
| 53 | + <el-table-column prop="vacationtype" label="工单类型" min-width="80" :formatter="formatType" sortable> | ||
| 54 | + </el-table-column> | ||
| 55 | + <el-table-column prop="processstatus" label="工单状态" min-width="80" :formatter="formatState" sortable> | ||
| 56 | + </el-table-column> | ||
| 57 | + <el-table-column label="操作" min-width="260"> | ||
| 58 | + <template slot-scope="scope"> | ||
| 59 | + <!--<el-button size="small" @click="setPerm(scope.$index, scope.row)">分配工单</el-button>--> | ||
| 60 | + <el-button size="small" @click="shwoDialog(scope.$index, scope.row)">查看内容</el-button> | ||
| 61 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
| 62 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 63 | + </template> | ||
| 64 | + </el-table-column> | ||
| 65 | + </el-table> | ||
| 66 | + | ||
| 67 | + <!--工具条--> | ||
| 68 | + <el-col :span="24" class="toolbar"> | ||
| 69 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 70 | + <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 71 | + </el-pagination> | ||
| 72 | + </el-col> | ||
| 73 | + | ||
| 74 | + <!--编辑界面--> | ||
| 75 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 76 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 77 | + <el-form-item label="ID"> | ||
| 78 | + <span>{{editForm.roleId}}</span> | ||
| 79 | + </el-form-item> | ||
| 80 | + <el-form-item label="岗位名称"> | ||
| 81 | + <el-input v-model="editForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input> | ||
| 82 | + </el-form-item> | ||
| 83 | + <el-form-item label="岗位描述"> | ||
| 84 | + <el-input v-model="editForm.description" auto-complete="off" placeholder="请输入岗位/角色描述:例如:用户管理员"></el-input> | ||
| 85 | + </el-form-item> | ||
| 86 | + <el-form-item label="部门名称"> | ||
| 87 | + <el-select v-model="editForm.departmentId" placeholder="请选择"> | ||
| 88 | + <el-option | ||
| 89 | + v-for="item in departmentNameList" | ||
| 90 | + :key="item.departmentId" | ||
| 91 | + :label="item.departmentName" | ||
| 92 | + :value="item.departmentId"> | ||
| 93 | + </el-option> | ||
| 94 | + </el-select> | ||
| 95 | + </el-form-item> | ||
| 96 | + </el-form> | ||
| 97 | + <div slot="footer" class="dialog-footer"> | ||
| 98 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 99 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
| 100 | + </div> | ||
| 101 | + </el-dialog> | ||
| 102 | + | ||
| 103 | + <!--新增界面--> | ||
| 104 | + <el-dialog title="新增" :visible.sync="addFormVisible" width="60%"> | ||
| 105 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 106 | + <el-form-item label="工单名称" prop="processname"> | ||
| 107 | + <el-input v-model="addForm.processname" auto-complete="off" placeholder="请输入工单标题:"></el-input> | ||
| 108 | + </el-form-item> | ||
| 109 | + <el-form-item label="开始日期" prop="begindate"> | ||
| 110 | + <el-date-picker :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择时间" v-model="addForm.begindate" style="width: 100%;"></el-date-picker> | ||
| 111 | + </el-form-item> | ||
| 112 | + <el-form-item label="结束日期" prop="enddate"> | ||
| 113 | + <el-date-picker :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择时间" v-model="addForm.enddate" style="width: 100%;"></el-date-picker> | ||
| 114 | + </el-form-item> | ||
| 115 | + <el-form-item label="工单类型" prop="vacationtype"> | ||
| 116 | + <el-cascader-panel | ||
| 117 | + :options="vacationTypeOptions" | ||
| 118 | + v-model="addForm.vacationtype" | ||
| 119 | + @change="cascaderhandleChange"></el-cascader-panel> | ||
| 120 | + </el-form-item> | ||
| 121 | + <el-form-item label="工单内容" prop="reason"> | ||
| 122 | + <el-input type="textarea" v-model="addForm.reason"></el-input> | ||
| 123 | + </el-form-item> | ||
| 124 | + <el-form-item label="指定部门"> | ||
| 125 | + <el-tree | ||
| 126 | + :data="options" | ||
| 127 | + v-model="addForm.jobuserid" | ||
| 128 | + show-checkbox | ||
| 129 | + ref="tree" | ||
| 130 | + node-key="value" | ||
| 131 | + @check-change="handleCheckChange" | ||
| 132 | + :props="defaultProps"> | ||
| 133 | + </el-tree> | ||
| 134 | + </el-form-item> | ||
| 135 | + </el-form> | ||
| 136 | + <div slot="footer" class="dialog-footer"> | ||
| 137 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 138 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 139 | + </div> | ||
| 140 | + </el-dialog> | ||
| 141 | + </section> | ||
| 142 | +</template> | ||
| 143 | + | ||
| 144 | +<script> | ||
| 145 | + import util from '../../common/js/util' | ||
| 146 | + import NProgress from 'nprogress' | ||
| 147 | + import { getList,add,vacationTypeOptions} from '@/api/process_api'; | ||
| 148 | + import moment from 'moment' | ||
| 149 | + import {parseTime, pickerOptions} from '@/utils' | ||
| 150 | + import loginUserInfo from '@/api/base' | ||
| 151 | + import ElFormItem from "../../../node_modules/element-ui/packages/form/src/form-item.vue"; | ||
| 152 | + export default { | ||
| 153 | + components: {ElFormItem}, | ||
| 154 | + data() { | ||
| 155 | + return { | ||
| 156 | + filters: { | ||
| 157 | + processName: '', | ||
| 158 | + parseTime: parseTime | ||
| 159 | + }, | ||
| 160 | + departmentNameList:[], | ||
| 161 | + processList: [], | ||
| 162 | + permissons: [], | ||
| 163 | + permIds: [], | ||
| 164 | + total: 0, | ||
| 165 | + pageNum: 1, | ||
| 166 | + pageSize: 5, | ||
| 167 | + listLoading: false, | ||
| 168 | + sels: [],//列表选中列 | ||
| 169 | + //编辑界面是否显示 | ||
| 170 | + editFormVisible: false, | ||
| 171 | + editLoading: false, | ||
| 172 | + editFormRules: { | ||
| 173 | + roleName: [ | ||
| 174 | + { required: true, message: '请输入岗位/角色名称', trigger: 'blur' } | ||
| 175 | + ] | ||
| 176 | + }, | ||
| 177 | + //编辑界面数据 | ||
| 178 | + editForm: { | ||
| 179 | + roleId: 1, | ||
| 180 | + description: '', | ||
| 181 | + roleName: '', | ||
| 182 | + roleSign: 1, | ||
| 183 | + departmentId:'' | ||
| 184 | + }, | ||
| 185 | + //新增界面是否显示 | ||
| 186 | + addFormVisible: false, | ||
| 187 | + //设置权限界面是否显示 | ||
| 188 | + PermFormVisible: false, | ||
| 189 | + addLoading: false, | ||
| 190 | + addFormRules: { | ||
| 191 | + roleName: [ | ||
| 192 | + { required: true, message: '请输入岗位/角色名称', trigger: 'blur' } | ||
| 193 | + ], | ||
| 194 | + description: [ | ||
| 195 | + { required: true, message: '请输入岗位/角色描述', trigger: 'blur' } | ||
| 196 | + ] | ||
| 197 | + }, | ||
| 198 | + //新增界面数据 | ||
| 199 | + addForm: { | ||
| 200 | + processname: '', | ||
| 201 | + begindate: '', | ||
| 202 | + enddate: '', | ||
| 203 | + vacationtype:'', | ||
| 204 | + reason: '', | ||
| 205 | + userId: '', | ||
| 206 | + jobuserid: 0 | ||
| 207 | + }, | ||
| 208 | + jobForm: { | ||
| 209 | + taskid: 1, | ||
| 210 | + userid: 1, | ||
| 211 | + auditresuld: '' | ||
| 212 | + }, | ||
| 213 | + centerDialogVisible: false, | ||
| 214 | + dialogData:{}, | ||
| 215 | + options:[{ | ||
| 216 | + value: '1', | ||
| 217 | + label: '测试公司', | ||
| 218 | + children: [{ | ||
| 219 | + value: '2', | ||
| 220 | + label: '测试部门一', | ||
| 221 | + children: [{ | ||
| 222 | + value: '1', | ||
| 223 | + label: '测试岗位1' | ||
| 224 | + }] | ||
| 225 | + }, { | ||
| 226 | + value: '3', | ||
| 227 | + label: '测试部门二', | ||
| 228 | + children: [{ | ||
| 229 | + value: '2', | ||
| 230 | + label: '测试岗位2' | ||
| 231 | + }, { | ||
| 232 | + value: '3', | ||
| 233 | + label: '测试岗位3' | ||
| 234 | + }] | ||
| 235 | + }] | ||
| 236 | + }], | ||
| 237 | + defaultProps: { | ||
| 238 | + children: 'children', | ||
| 239 | + label: 'label' | ||
| 240 | + }, | ||
| 241 | + pickerOptions: pickerOptions, | ||
| 242 | + vacationTypeOptions: vacationTypeOptions | ||
| 243 | + } | ||
| 244 | + }, | ||
| 245 | + methods: { | ||
| 246 | + //性别显示转换 | ||
| 247 | + formatType: function (row, column) { | ||
| 248 | + return row.vacationtype == 1 ? '运维检查' : row.vacationtype == 0 ? '设备故障' : '电话报修'; | ||
| 249 | + }, | ||
| 250 | + formatState: function (row, column) { | ||
| 251 | + let msg = '未知'; | ||
| 252 | + switch (row.processstatus){ | ||
| 253 | + case 0: | ||
| 254 | + msg='未分配'; | ||
| 255 | + break; | ||
| 256 | + case 1: | ||
| 257 | + msg='已分配'; | ||
| 258 | + break; | ||
| 259 | + case 2: | ||
| 260 | + msg='执行中'; | ||
| 261 | + break; | ||
| 262 | + case 3: | ||
| 263 | + msg='已完成'; | ||
| 264 | + break; | ||
| 265 | + } | ||
| 266 | + return msg; | ||
| 267 | + }, | ||
| 268 | + handleCurrentChange(val) { | ||
| 269 | + this.pageNum = val; | ||
| 270 | + }, | ||
| 271 | + //获取工单列表 | ||
| 272 | + getProcessList() { | ||
| 273 | + let para = { | ||
| 274 | + pageNum: this.pageNum, | ||
| 275 | + pageSize: this.pageSize, | ||
| 276 | + roleName: this.filters.processName | ||
| 277 | + }; | ||
| 278 | + this.listLoading = true; | ||
| 279 | + //NProgress.start(); | ||
| 280 | + getList(para).then((res) => { | ||
| 281 | + let resData = res.data.data; | ||
| 282 | + this.total = resData.total; | ||
| 283 | + this.processList = resData.list; | ||
| 284 | + this.listLoading = false; | ||
| 285 | + //NProgress.done(); | ||
| 286 | + }).catch((error) => { | ||
| 287 | + this.listLoading = false; | ||
| 288 | + if(null!= error.response && error.response!==undefined){ | ||
| 289 | + let status= error.response.status; | ||
| 290 | + let msg = error.response.statusText; | ||
| 291 | + alert(status+msg); | ||
| 292 | + }else { | ||
| 293 | + alert(error); | ||
| 294 | + } | ||
| 295 | + | ||
| 296 | + }); | ||
| 297 | + | ||
| 298 | + }, | ||
| 299 | + //删除 | ||
| 300 | + handleDel: function (index, row) { | ||
| 301 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 302 | + type: 'warning' | ||
| 303 | + }).then(() => { | ||
| 304 | + this.listLoading = true; | ||
| 305 | + //NProgress.start(); | ||
| 306 | + let para = { roleId: row.roleId }; | ||
| 307 | + remove(para).then((res) => { | ||
| 308 | + this.listLoading = false; | ||
| 309 | + //NProgress.done(); | ||
| 310 | + this.$message({ | ||
| 311 | + message: '删除成功', | ||
| 312 | + type: 'success' | ||
| 313 | + }); | ||
| 314 | + }).catch((error) => { | ||
| 315 | + this.listLoading = false; | ||
| 316 | + alert(error); | ||
| 317 | + }); | ||
| 318 | + }).catch(); | ||
| 319 | + }, | ||
| 320 | + /** | ||
| 321 | + * 显示编辑界面 | ||
| 322 | + * @param index | ||
| 323 | + * @param row 为这行的数据对象 | ||
| 324 | + */ | ||
| 325 | + handleEdit: function (index, row) { | ||
| 326 | + this.editFormVisible = true; | ||
| 327 | + this.editForm = Object.assign({}, row); | ||
| 328 | + this.getdepartmentNames(); | ||
| 329 | + }, | ||
| 330 | + //显示新增界面,每次点开初始化数据 | ||
| 331 | + handleAdd: function () { | ||
| 332 | + this.addFormVisible = true; | ||
| 333 | + this.addForm = { | ||
| 334 | + processname: '', | ||
| 335 | + begindate: '', | ||
| 336 | + enddate: '', | ||
| 337 | + vacationtype:'', | ||
| 338 | + reason: '', | ||
| 339 | + userid: loginUserInfo.userId, | ||
| 340 | + jobuserid: 0 | ||
| 341 | + } | ||
| 342 | + }, | ||
| 343 | + //编辑 | ||
| 344 | + editSubmit: function () { | ||
| 345 | + this.$refs.editForm.validate((valid) => { | ||
| 346 | + if (valid) { | ||
| 347 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 348 | + this.editLoading = true; | ||
| 349 | + //NProgress.start(); | ||
| 350 | + let para = Object.assign({}, this.editForm); | ||
| 351 | + //不需要提交的 去掉,后端不好接收 | ||
| 352 | + para.authorities = null; | ||
| 353 | + para.permissions = null; | ||
| 354 | + para.roles = null; | ||
| 355 | +// para.birth = (!para.birth || para.birth == '') ? '' : util.formatDate.format(new Date(para.birth), 'yyyy-MM-dd'); | ||
| 356 | + /* | ||
| 357 | + 查询之后格式this.filters.column.create_start_date中日期发生变化; | ||
| 358 | + Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) 变成了 "2017-08-08T16:00:00.000Z"; | ||
| 359 | + 所以使用 moment 日期格式化插件将时间转换成 [ Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) ] 格 | ||
| 360 | + 式; | ||
| 361 | + */ | ||
| 362 | + /*moment 安装 npm install moment --save*/ | ||
| 363 | + para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss'); | ||
| 364 | + this.editLoading = false; | ||
| 365 | + edit(para).then((res) => { | ||
| 366 | + | ||
| 367 | + //NProgress.done(); | ||
| 368 | + this.$message({ | ||
| 369 | + message: '提交成功', | ||
| 370 | + type: 'success' | ||
| 371 | + }); | ||
| 372 | + this.$refs['editForm'].resetFields(); | ||
| 373 | + this.editFormVisible = false; | ||
| 374 | + }).catch(error => alert(error)); | ||
| 375 | + }); | ||
| 376 | + } | ||
| 377 | + }); | ||
| 378 | + }, | ||
| 379 | + //新增 | ||
| 380 | + addSubmit: function () { | ||
| 381 | + this.$refs.addForm.validate((valid) => { | ||
| 382 | + if (valid) { | ||
| 383 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 384 | + this.addLoading = true; | ||
| 385 | + //NProgress.start(); | ||
| 386 | + let para = Object.assign({}, this.addForm); | ||
| 387 | + add(para).then((res) => { | ||
| 388 | + this.addLoading = false; | ||
| 389 | + if (res.status ===200) { | ||
| 390 | + this.$message({ | ||
| 391 | + message: '提交成功', | ||
| 392 | + type: 'success' | ||
| 393 | + }); | ||
| 394 | + this.$refs['jobForm'].resetFields(); | ||
| 395 | + this.addFormVisible = false; | ||
| 396 | + this.getProcessList(); | ||
| 397 | + } | ||
| 398 | + }).catch(error => alert(error)); | ||
| 399 | + }); | ||
| 400 | + } | ||
| 401 | + }); | ||
| 402 | + }, | ||
| 403 | + selsChange: function (sels) { | ||
| 404 | + this.sels = sels; | ||
| 405 | + }, | ||
| 406 | + //批量删除 | ||
| 407 | + batchRemove: function () { | ||
| 408 | + var ids = this.sels.map(item => item.roleId).toString(); | ||
| 409 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 410 | + type: 'warning' | ||
| 411 | + }).then(() => { | ||
| 412 | + this.listLoading = true; | ||
| 413 | + //NProgress.start(); | ||
| 414 | + let para = { ids: ids }; | ||
| 415 | + batchRemove(para).then((res) => { | ||
| 416 | + this.listLoading = false; | ||
| 417 | + //NProgress.done(); | ||
| 418 | + this.$message({ | ||
| 419 | + message: '删除成功', | ||
| 420 | + type: 'success' | ||
| 421 | + }) | ||
| 422 | + }); | ||
| 423 | + }).catch(() => { | ||
| 424 | + | ||
| 425 | + }); | ||
| 426 | + }, | ||
| 427 | + shwoDialog(index,row) { | ||
| 428 | + this.dialogData = Object.assign({}, row); | ||
| 429 | + this.centerDialogVisible = true; | ||
| 430 | + }, | ||
| 431 | + checkJobs(index,row) { | ||
| 432 | + let p = Object.assign({}, row); | ||
| 433 | + this.$router.push( | ||
| 434 | + { | ||
| 435 | + name: '任务管理', | ||
| 436 | + params: { | ||
| 437 | + formid: p.formid | ||
| 438 | + } | ||
| 439 | + } | ||
| 440 | + ) | ||
| 441 | + }, | ||
| 442 | + //级联面板事件 | ||
| 443 | + cascaderhandleChange:function (value) { | ||
| 444 | + let defaultvalue = ["0","0","0","0"]; | ||
| 445 | + defaultvalue = value; | ||
| 446 | + console.log(defaultvalue); | ||
| 447 | + }, | ||
| 448 | + //el-tree绑定事件 | ||
| 449 | + handleCheckChange(data, checked, indeterminate) { | ||
| 450 | +// console.log(data, checked, indeterminate); | ||
| 451 | + console.log(this.$refs.tree.getCheckedNodes()); | ||
| 452 | + console.log(this.$refs.tree.getCheckedKeys()); | ||
| 453 | +// this.addForm.jobuserid = defaultvalue; | ||
| 454 | + } | ||
| 455 | + }, | ||
| 456 | + mounted() { | ||
| 457 | + this.getProcessList(); | ||
| 458 | + } | ||
| 459 | + } | ||
| 460 | + | ||
| 461 | +</script> | ||
| 462 | + | ||
| 463 | +<style scoped> | ||
| 464 | + | ||
| 465 | +</style> |
src/views/nav1/Log.vue
100644 → 100755
| @@ -7,13 +7,10 @@ | @@ -7,13 +7,10 @@ | ||
| 7 | <el-input v-model="filters.username" placeholder="账号"></el-input> | 7 | <el-input v-model="filters.username" placeholder="账号"></el-input> |
| 8 | </el-form-item> | 8 | </el-form-item> |
| 9 | <el-form-item> | 9 | <el-form-item> |
| 10 | - <el-input v-model="filters.methodname" placeholder="系统动作"></el-input> | ||
| 11 | - </el-form-item> | ||
| 12 | - <el-form-item> | ||
| 13 | <el-input v-model="filters.modelnamecn" placeholder="操作模块"></el-input> | 10 | <el-input v-model="filters.modelnamecn" placeholder="操作模块"></el-input> |
| 14 | </el-form-item> | 11 | </el-form-item> |
| 15 | <el-form-item> | 12 | <el-form-item> |
| 16 | - <el-button type="primary" v-on:click="getRoles()">查询</el-button> | 13 | + <el-button type="primary" v-on:click="getLogs()">查询</el-button> |
| 17 | </el-form-item> | 14 | </el-form-item> |
| 18 | </el-form> | 15 | </el-form> |
| 19 | </el-col> | 16 | </el-col> |
| @@ -35,8 +32,6 @@ | @@ -35,8 +32,6 @@ | ||
| 35 | </el-table-column> | 32 | </el-table-column> |
| 36 | <el-table-column prop="modelnamecn" label="操作模块" width="120" sortable> | 33 | <el-table-column prop="modelnamecn" label="操作模块" width="120" sortable> |
| 37 | </el-table-column> | 34 | </el-table-column> |
| 38 | - <!--<el-table-column prop="parameters" label="参数" width="100" sortable>--> | ||
| 39 | - <!--</el-table-column>--> | ||
| 40 | <el-table-column prop="classname" label="系统类" show-overflow-tooltip="true" width="100" sortable> | 35 | <el-table-column prop="classname" label="系统类" show-overflow-tooltip="true" width="100" sortable> |
| 41 | </el-table-column> | 36 | </el-table-column> |
| 42 | <el-table-column prop="result" label="操作结果" min-width="200" sortable> | 37 | <el-table-column prop="result" label="操作结果" min-width="200" sortable> |
| @@ -45,7 +40,7 @@ | @@ -45,7 +40,7 @@ | ||
| 45 | 40 | ||
| 46 | <!--工具条--> | 41 | <!--工具条--> |
| 47 | <el-col :span="24" class="toolbar"> | 42 | <el-col :span="24" class="toolbar"> |
| 48 | - <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="10" :total="total" style="float:right;"> | 43 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="10" :total="total" style="float:right;"> |
| 49 | </el-pagination> | 44 | </el-pagination> |
| 50 | </el-col> | 45 | </el-col> |
| 51 | </section> | 46 | </section> |
| @@ -59,7 +54,10 @@ | @@ -59,7 +54,10 @@ | ||
| 59 | export default { | 54 | export default { |
| 60 | data() { | 55 | data() { |
| 61 | return { | 56 | return { |
| 62 | - filters: {}, | 57 | + filters: { |
| 58 | + modelnamecn:'', | ||
| 59 | + username: '' | ||
| 60 | + }, | ||
| 63 | logs: [], | 61 | logs: [], |
| 64 | total: 0, | 62 | total: 0, |
| 65 | pageNum: 1, | 63 | pageNum: 1, |
| @@ -78,13 +76,15 @@ | @@ -78,13 +76,15 @@ | ||
| 78 | }, | 76 | }, |
| 79 | handleCurrentChange(val) { | 77 | handleCurrentChange(val) { |
| 80 | this.pageNum = val; | 78 | this.pageNum = val; |
| 81 | - this.getRoles(); | 79 | + this.getLogs(); |
| 82 | }, | 80 | }, |
| 83 | //获取角色列表 | 81 | //获取角色列表 |
| 84 | getLogs() { | 82 | getLogs() { |
| 85 | let para = { | 83 | let para = { |
| 86 | pageNum: this.pageNum, | 84 | pageNum: this.pageNum, |
| 87 | pageSize: this.pageSize, | 85 | pageSize: this.pageSize, |
| 86 | + modelnamecn: this.filters.modelnamecn, | ||
| 87 | + username: this.filters.username | ||
| 88 | }; | 88 | }; |
| 89 | this.listLoading = true; | 89 | this.listLoading = true; |
| 90 | //NProgress.start(); | 90 | //NProgress.start(); |
| @@ -112,28 +112,6 @@ | @@ -112,28 +112,6 @@ | ||
| 112 | selsChange: function (sels) { | 112 | selsChange: function (sels) { |
| 113 | this.sels = sels; | 113 | this.sels = sels; |
| 114 | }, | 114 | }, |
| 115 | - //批量删除 | ||
| 116 | - batchRemove: function () { | ||
| 117 | - var ids = this.sels.map(item => item.id).toString(); | ||
| 118 | - this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 119 | - type: 'warning' | ||
| 120 | - }).then(() => { | ||
| 121 | - this.listLoading = true; | ||
| 122 | - //NProgress.start(); | ||
| 123 | - let para = { ids: ids }; | ||
| 124 | - batchRemove(para).then((res) => { | ||
| 125 | - this.listLoading = false; | ||
| 126 | - //NProgress.done(); | ||
| 127 | - this.$message({ | ||
| 128 | - message: '删除成功', | ||
| 129 | - type: 'success' | ||
| 130 | - }); | ||
| 131 | - this.getRoles(); | ||
| 132 | - }); | ||
| 133 | - }).catch(() => { | ||
| 134 | - | ||
| 135 | - }); | ||
| 136 | - } | ||
| 137 | }, | 115 | }, |
| 138 | mounted() { | 116 | mounted() { |
| 139 | this.getLogs(); | 117 | this.getLogs(); |
| @@ -55,12 +55,12 @@ | @@ -55,12 +55,12 @@ | ||
| 55 | <!--工具条--> | 55 | <!--工具条--> |
| 56 | <el-col :span="24" class="toolbar"> | 56 | <el-col :span="24" class="toolbar"> |
| 57 | <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | 57 | <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> |
| 58 | - <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | 58 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> |
| 59 | </el-pagination> | 59 | </el-pagination> |
| 60 | </el-col> | 60 | </el-col> |
| 61 | 61 | ||
| 62 | <!--编辑界面--> | 62 | <!--编辑界面--> |
| 63 | - <el-dialog title="编辑" v-model="editFormVisible" :close-on-click-modal="false"> | 63 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> |
| 64 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | 64 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> |
| 65 | <el-form-item label="ID"> | 65 | <el-form-item label="ID"> |
| 66 | <span>{{editForm.userId}}</span> | 66 | <span>{{editForm.userId}}</span> |
| @@ -109,7 +109,7 @@ | @@ -109,7 +109,7 @@ | ||
| 109 | </el-dialog> | 109 | </el-dialog> |
| 110 | 110 | ||
| 111 | <!--新增界面--> | 111 | <!--新增界面--> |
| 112 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 112 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 113 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 113 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 114 | <el-form-item label="账号" prop="username"> | 114 | <el-form-item label="账号" prop="username"> |
| 115 | <el-input v-model="addForm.username"></el-input> | 115 | <el-input v-model="addForm.username"></el-input> |
src/views/nav1/company.vue
0 → 100755
| 1 | +<template> | ||
| 2 | + <section> | ||
| 3 | + <!--工具条--> | ||
| 4 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
| 5 | + <el-form :inline="true" :model="filters"> | ||
| 6 | + <el-form-item> | ||
| 7 | + <el-input v-model="filters.companyName" placeholder="公司名称"></el-input> | ||
| 8 | + </el-form-item> | ||
| 9 | + <el-form-item> | ||
| 10 | + <el-button type="primary" v-on:click="getCompanys()">查询</el-button> | ||
| 11 | + </el-form-item> | ||
| 12 | + <el-form-item> | ||
| 13 | + <el-button type="primary" @click="companyAdd">新增</el-button> | ||
| 14 | + </el-form-item> | ||
| 15 | + </el-form> | ||
| 16 | + </el-col> | ||
| 17 | + | ||
| 18 | + <!--列表--> | ||
| 19 | + <el-table :data="companyList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;"> | ||
| 20 | + <el-table-column type="selection" width="55"> | ||
| 21 | + </el-table-column> | ||
| 22 | + <el-table-column type="index"> | ||
| 23 | + </el-table-column> | ||
| 24 | + <el-table-column prop="companyId" label="ID" sortable> | ||
| 25 | + </el-table-column> | ||
| 26 | + <el-table-column prop="companyName" label="公司名称" sortable> | ||
| 27 | + </el-table-column> | ||
| 28 | + <el-table-column prop="groupName" label="集团名称" sortable> | ||
| 29 | + </el-table-column> | ||
| 30 | + <el-table-column prop="creatTime" label="入库时间" sortable> | ||
| 31 | + </el-table-column> | ||
| 32 | + <el-table-column label="操作" min-width="150"> | ||
| 33 | + <template slot-scope="scope"> | ||
| 34 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
| 35 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 36 | + </template> | ||
| 37 | + </el-table-column> | ||
| 38 | + </el-table> | ||
| 39 | + | ||
| 40 | + <!--工具条--> | ||
| 41 | + <el-col :span="24" class="toolbar"> | ||
| 42 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 43 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 44 | + </el-pagination> | ||
| 45 | + </el-col> | ||
| 46 | + | ||
| 47 | + <!--编辑界面--> | ||
| 48 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 49 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 50 | + <el-form-item label="ID"> | ||
| 51 | + <span>{{editForm.companyId}}</span> | ||
| 52 | + </el-form-item> | ||
| 53 | + <el-form-item label="公司名称"> | ||
| 54 | + <el-input v-model="editForm.companyName" auto-complete="off" placeholder="请输入公司名称"></el-input> | ||
| 55 | + </el-form-item> | ||
| 56 | + <el-form-item label="集团名称"> | ||
| 57 | + <el-select v-model="editForm.groupId" placeholder="请选择"> | ||
| 58 | + <el-option | ||
| 59 | + v-for="item in groupLists" | ||
| 60 | + :key="item.groupId" | ||
| 61 | + :label="item.groupName" | ||
| 62 | + :value="item.groupId"> | ||
| 63 | + </el-option> | ||
| 64 | + </el-select> | ||
| 65 | + </el-form-item> | ||
| 66 | + </el-form> | ||
| 67 | + <div slot="footer" class="dialog-footer"> | ||
| 68 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 69 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
| 70 | + </div> | ||
| 71 | + </el-dialog> | ||
| 72 | + | ||
| 73 | + <!--新增界面--> | ||
| 74 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
| 75 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 76 | + <el-form-item label="公司名称" prop="companyName"> | ||
| 77 | + <el-input v-model="addForm.companyName" auto-complete="off" placeholder="请输入公司名称"></el-input> | ||
| 78 | + </el-form-item> | ||
| 79 | + <el-form-item label="集团名称" prop="groupId"> | ||
| 80 | + <el-select v-model="addForm.groupId" placeholder="请选择"> | ||
| 81 | + <el-option | ||
| 82 | + v-for="item in groupLists" | ||
| 83 | + :key="item.groupId" | ||
| 84 | + :label="item.groupName" | ||
| 85 | + :value="item.groupId"> | ||
| 86 | + </el-option> | ||
| 87 | + </el-select> | ||
| 88 | + </el-form-item> | ||
| 89 | + </el-form> | ||
| 90 | + <div slot="footer" class="dialog-footer"> | ||
| 91 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 92 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 93 | + </div> | ||
| 94 | + </el-dialog> | ||
| 95 | + </section> | ||
| 96 | +</template> | ||
| 97 | + | ||
| 98 | +<script> | ||
| 99 | + import util from '../../common/js/util' | ||
| 100 | + import NProgress from 'nprogress' | ||
| 101 | + import { getList, remove, batchRemove, edit, add } from '../../api/company'; | ||
| 102 | + import { getList as groupList } from '../../api/group_company'; | ||
| 103 | + import moment from 'moment' | ||
| 104 | + | ||
| 105 | + export default { | ||
| 106 | + data() { | ||
| 107 | + return { | ||
| 108 | + filters: { | ||
| 109 | + companyName: '' | ||
| 110 | + }, | ||
| 111 | + companyList: [], | ||
| 112 | + // 接受集团名称 | ||
| 113 | + groupLists:[], | ||
| 114 | + permIds: [], | ||
| 115 | + total: 0, | ||
| 116 | + pageNum: 1, | ||
| 117 | + pageSize: 5, | ||
| 118 | + listLoading: false, | ||
| 119 | + sels: [],//列表选中列 | ||
| 120 | + //编辑界面是否显示 | ||
| 121 | + editFormVisible: false, | ||
| 122 | + editLoading: false, | ||
| 123 | + editFormRules: { | ||
| 124 | + companyName: [ | ||
| 125 | + { required: true, message: '请输入公司名称', trigger: 'blur' } | ||
| 126 | + ] | ||
| 127 | + }, | ||
| 128 | + //编辑界面数据 | ||
| 129 | + editForm: { | ||
| 130 | + companyId: '', | ||
| 131 | + companyName: '', | ||
| 132 | + groupId: '' | ||
| 133 | + }, | ||
| 134 | + //设置权限数据 | ||
| 135 | + setPermForm: {}, | ||
| 136 | + //新增界面是否显示 | ||
| 137 | + addFormVisible: false, | ||
| 138 | + //设置权限界面是否显示 | ||
| 139 | + PermFormVisible: false, | ||
| 140 | + addLoading: false, | ||
| 141 | + addFormRules: { | ||
| 142 | + companyName: [ | ||
| 143 | + { required: true, message: '请输入公司名称', trigger: 'blur' } | ||
| 144 | + ] | ||
| 145 | + }, | ||
| 146 | + | ||
| 147 | + //新增界面数据 | ||
| 148 | + addForm: { | ||
| 149 | + companyName: '', | ||
| 150 | + groupId: '' | ||
| 151 | + }, | ||
| 152 | + companyFrom: { | ||
| 153 | + companyId: 1, | ||
| 154 | + companyName: '', | ||
| 155 | + companys: [] | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + } | ||
| 159 | + }, | ||
| 160 | + mounted() { | ||
| 161 | + this.getCompanys(); | ||
| 162 | + }, | ||
| 163 | + methods: { | ||
| 164 | + | ||
| 165 | + handleCurrentChange(val) { | ||
| 166 | + this.pageNum = val; | ||
| 167 | + this.getRoles(); | ||
| 168 | + }, | ||
| 169 | + //获取公司列表 | ||
| 170 | + getCompanys() { | ||
| 171 | + let para = { | ||
| 172 | + pageNum: this.pageNum, | ||
| 173 | + pageSize: this.pageSize, | ||
| 174 | + companyName: this.filters.companyName | ||
| 175 | + }; | ||
| 176 | + this.listLoading = true; | ||
| 177 | + //NProgress.start(); | ||
| 178 | + getList(para).then((res) => { | ||
| 179 | + this.total = res.data.total; | ||
| 180 | + this.companyList = res.data.list; | ||
| 181 | + console.log(this.companyList); | ||
| 182 | + this.listLoading = false; | ||
| 183 | + //NProgress.done(); | ||
| 184 | + }).catch((error) => { | ||
| 185 | + | ||
| 186 | + this.listLoading = false; | ||
| 187 | + if(null!= error.response && error.response!==undefined){ | ||
| 188 | + let status= error.response.status; | ||
| 189 | + let msg = error.response.statusText; | ||
| 190 | + alert(status+msg); | ||
| 191 | + }else { | ||
| 192 | + alert(error); | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + }); | ||
| 196 | + | ||
| 197 | + }, | ||
| 198 | + | ||
| 199 | + //获取集团列表 | ||
| 200 | + getGroupComapnys() { | ||
| 201 | + | ||
| 202 | + this.listLoading = true; | ||
| 203 | + //NProgress.start(); | ||
| 204 | + groupList().then((res) => { | ||
| 205 | + this.total = res.data.total; | ||
| 206 | + this.groupLists = res.data.list; | ||
| 207 | + console.log(this.companyList); | ||
| 208 | + this.listLoading = false; | ||
| 209 | + //NProgress.done(); | ||
| 210 | + }).catch((error) => { | ||
| 211 | + | ||
| 212 | + this.listLoading = false; | ||
| 213 | + if(null!= error.response && error.response!==undefined){ | ||
| 214 | + let status= error.response.status; | ||
| 215 | + let msg = error.response.statusText; | ||
| 216 | + alert(status+msg); | ||
| 217 | + }else { | ||
| 218 | + alert(error); | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + }); | ||
| 222 | + | ||
| 223 | + }, | ||
| 224 | + | ||
| 225 | + //删除 | ||
| 226 | + handleDel: function (index, row) { | ||
| 227 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 228 | + type: 'warning' | ||
| 229 | + }).then(() => { | ||
| 230 | + this.listLoading = true; | ||
| 231 | + //NProgress.start(); | ||
| 232 | + let para = { companyId: row.companyId }; | ||
| 233 | + remove(para).then((res) => { | ||
| 234 | + this.listLoading = false; | ||
| 235 | + //NProgress.done(); | ||
| 236 | + this.$message({ | ||
| 237 | + message: '删除成功', | ||
| 238 | + type: 'success' | ||
| 239 | + }); | ||
| 240 | + this.getCompanys(); | ||
| 241 | + }).catch((error) => { | ||
| 242 | + this.listLoading = false; | ||
| 243 | + alert(error); | ||
| 244 | + }); | ||
| 245 | + }).catch(); | ||
| 246 | + }, | ||
| 247 | + /** | ||
| 248 | + * 显示编辑界面 | ||
| 249 | + * @param index | ||
| 250 | + * @param row 为这行的数据对象 | ||
| 251 | + */ | ||
| 252 | + handleEdit: function (index, row) { | ||
| 253 | + this.editFormVisible = true; | ||
| 254 | + this.editForm = Object.assign({}, row); | ||
| 255 | + this.getGroupComapnys(); | ||
| 256 | + }, | ||
| 257 | + setPerm: function (index, row) { | ||
| 258 | + var _this = this; | ||
| 259 | + this.companyIds = []; | ||
| 260 | + this.PermFormVisible = true; | ||
| 261 | + this.companyFrom = Object.assign({}, row); | ||
| 262 | + let rolePerms = this.companyFrom.companys; | ||
| 263 | + if (util.checkNull(rolePerms)){ | ||
| 264 | + rolePerms.forEach(function (company,v_index,v_arr) { | ||
| 265 | + if(util.checkNull(perm)){ | ||
| 266 | + _this.companyIds[v_index] = company.companyId; | ||
| 267 | + } | ||
| 268 | + }); | ||
| 269 | + } | ||
| 270 | + this.getPermList(); | ||
| 271 | + }, | ||
| 272 | + //显示新增界面,每次点开初始化数据 | ||
| 273 | + companyAdd: function () { | ||
| 274 | + this.addFormVisible = true; | ||
| 275 | + this.addForm = { | ||
| 276 | + companyName: '', | ||
| 277 | + groupId: '' | ||
| 278 | + }; | ||
| 279 | + this.getGroupComapnys(); | ||
| 280 | + }, | ||
| 281 | + | ||
| 282 | + //新增 | ||
| 283 | + addSubmit: function () { | ||
| 284 | + this.$refs.addForm.validate((valid) => { | ||
| 285 | + if (valid) { | ||
| 286 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 287 | + this.addLoading = true; | ||
| 288 | + //NProgress.start(); | ||
| 289 | + let para = Object.assign({}, this.addForm); | ||
| 290 | + add(para).then((res) => { | ||
| 291 | + this.addLoading = false; | ||
| 292 | + //NProgress.done(); | ||
| 293 | + this.$message({ | ||
| 294 | + message: '提交成功', | ||
| 295 | + type: 'success' | ||
| 296 | + }); | ||
| 297 | + this.$refs['addForm'].resetFields(); | ||
| 298 | + this.addFormVisible = false; | ||
| 299 | + this.getCompanys(); | ||
| 300 | + }).catch(error => alert(error)); | ||
| 301 | + }); | ||
| 302 | + } | ||
| 303 | + }); | ||
| 304 | + }, | ||
| 305 | + //编辑 | ||
| 306 | + editSubmit: function () { | ||
| 307 | + this.$refs.editForm.validate((valid) => { | ||
| 308 | + if (valid) { | ||
| 309 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 310 | + this.editLoading = true; | ||
| 311 | + let para = Object.assign({}, this.editForm); | ||
| 312 | + this.editLoading = false; | ||
| 313 | + edit(para).then((res) => { | ||
| 314 | + | ||
| 315 | + //NProgress.done(); | ||
| 316 | + this.$message({ | ||
| 317 | + message: '提交成功', | ||
| 318 | + type: 'success' | ||
| 319 | + }); | ||
| 320 | + this.$refs['editForm'].resetFields(); | ||
| 321 | + this.editFormVisible = false; | ||
| 322 | + this.getCompanys(); | ||
| 323 | + }).catch(error => alert(error)); | ||
| 324 | + }); | ||
| 325 | + } | ||
| 326 | + }); | ||
| 327 | + }, | ||
| 328 | + | ||
| 329 | + selsChange: function (sels) { | ||
| 330 | + this.sels = sels; | ||
| 331 | + }, | ||
| 332 | + //批量删除 | ||
| 333 | + batchRemove: function () { | ||
| 334 | + var ids = this.sels.map(item => item.companyId).toString(); | ||
| 335 | + console.log(ids); | ||
| 336 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 337 | + type: 'warning' | ||
| 338 | + }).then(() => { | ||
| 339 | + this.listLoading = true; | ||
| 340 | + //NProgress.start(); | ||
| 341 | + let para = { ids: ids }; | ||
| 342 | + batchRemove(para).then((res) => { | ||
| 343 | + this.listLoading = false; | ||
| 344 | + //NProgress.done(); | ||
| 345 | + this.$message({ | ||
| 346 | + message: '删除成功', | ||
| 347 | + type: 'success' | ||
| 348 | + }); | ||
| 349 | + this.getCompanys(); | ||
| 350 | + }); | ||
| 351 | + }).catch(() => { | ||
| 352 | + | ||
| 353 | + }); | ||
| 354 | + } | ||
| 355 | + }, | ||
| 356 | + | ||
| 357 | + } | ||
| 358 | +</script> |
src/views/nav1/department.vue
0 → 100755
| 1 | +<template> | ||
| 2 | + <section> | ||
| 3 | + <!--工具条--> | ||
| 4 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
| 5 | + <el-form :inline="true" :model="filters"> | ||
| 6 | + <el-form-item> | ||
| 7 | + <el-input v-model="filters.departmentName" placeholder="部门名称"></el-input> | ||
| 8 | + </el-form-item> | ||
| 9 | + <el-form-item> | ||
| 10 | + <el-button type="primary" v-on:click="getDepartments()">查询</el-button> | ||
| 11 | + </el-form-item> | ||
| 12 | + <el-form-item> | ||
| 13 | + <el-button type="primary" @click="departmentAdd">新增</el-button> | ||
| 14 | + </el-form-item> | ||
| 15 | + </el-form> | ||
| 16 | + </el-col> | ||
| 17 | + | ||
| 18 | + <!--列表--> | ||
| 19 | + <el-table :data="departmentList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;"> | ||
| 20 | + <el-table-column type="selection" width="55"> | ||
| 21 | + </el-table-column> | ||
| 22 | + <el-table-column type="index"> | ||
| 23 | + </el-table-column> | ||
| 24 | + <el-table-column prop="departmentId" label="ID" sortable> | ||
| 25 | + </el-table-column> | ||
| 26 | + <el-table-column prop="departmentName" label="部门名称" sortable> | ||
| 27 | + </el-table-column> | ||
| 28 | + <el-table-column prop="companyName" label="所属公司名称" sortable> | ||
| 29 | + </el-table-column> | ||
| 30 | + <el-table-column prop="creatTime" label="入库时间" sortable> | ||
| 31 | + </el-table-column> | ||
| 32 | + <el-table-column label="操作" min-width="150"> | ||
| 33 | + <template slot-scope="scope"> | ||
| 34 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
| 35 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 36 | + </template> | ||
| 37 | + </el-table-column> | ||
| 38 | + </el-table> | ||
| 39 | + | ||
| 40 | + <!--工具条--> | ||
| 41 | + <el-col :span="24" class="toolbar"> | ||
| 42 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 43 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 44 | + </el-pagination> | ||
| 45 | + </el-col> | ||
| 46 | + | ||
| 47 | + <!--编辑界面--> | ||
| 48 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 49 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 50 | + <el-form-item label="ID"> | ||
| 51 | + <span>{{editForm.departmentId}}</span> | ||
| 52 | + </el-form-item> | ||
| 53 | + <el-form-item label="部门名称"> | ||
| 54 | + <el-input v-model="editForm.departmentName" auto-complete="off" placeholder="请输入公司名称"></el-input> | ||
| 55 | + </el-form-item> | ||
| 56 | + <el-form-item label="公司名称"> | ||
| 57 | + <el-select v-model="editForm.companyId" placeholder="请选择公司"> | ||
| 58 | + <el-option | ||
| 59 | + v-for="item in companyList" | ||
| 60 | + :key="item.companyId" | ||
| 61 | + :label="item.companyName" | ||
| 62 | + :value="item.companyId"> | ||
| 63 | + </el-option> | ||
| 64 | + </el-select> | ||
| 65 | + </el-form-item> | ||
| 66 | + </el-form> | ||
| 67 | + <div slot="footer" class="dialog-footer"> | ||
| 68 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 69 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
| 70 | + </div> | ||
| 71 | + </el-dialog> | ||
| 72 | + | ||
| 73 | + <!--新增界面--> | ||
| 74 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
| 75 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 76 | + <el-form-item label="部门名称" prop="deprtmentName"> | ||
| 77 | + <el-input v-model="addForm.departmentName" auto-complete="off" placeholder="请输入部门名称"></el-input> | ||
| 78 | + </el-form-item> | ||
| 79 | + <el-form-item label="公司名称" prop="companyId"> | ||
| 80 | + <el-select v-model="addForm.companyId" placeholder="请选择公司"> | ||
| 81 | + <el-option | ||
| 82 | + v-for="item in companyList" | ||
| 83 | + :key="item.companyId" | ||
| 84 | + :label="item.companyName" | ||
| 85 | + :value="item.companyId"> | ||
| 86 | + </el-option> | ||
| 87 | + </el-select> | ||
| 88 | + </el-form-item> | ||
| 89 | + </el-form> | ||
| 90 | + <div slot="footer" class="dialog-footer"> | ||
| 91 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 92 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 93 | + </div> | ||
| 94 | + </el-dialog> | ||
| 95 | + </section> | ||
| 96 | +</template> | ||
| 97 | + | ||
| 98 | +<script> | ||
| 99 | + import util from '../../common/js/util' | ||
| 100 | + import NProgress from 'nprogress' | ||
| 101 | + import { getList, remove, batchRemove, edit, add } from '../../api/department'; | ||
| 102 | + import { getList as getCompanyList } from '../../api/company'; | ||
| 103 | + import moment from 'moment' | ||
| 104 | + | ||
| 105 | + export default { | ||
| 106 | + data() { | ||
| 107 | + return { | ||
| 108 | + filters: { | ||
| 109 | + departmentName: '' | ||
| 110 | + }, | ||
| 111 | + | ||
| 112 | + departmentList: [], | ||
| 113 | + companyList: [], | ||
| 114 | + permIds: [], | ||
| 115 | + total: 0, | ||
| 116 | + pageNum: 1, | ||
| 117 | + pageSize: 10, | ||
| 118 | + listLoading: false, | ||
| 119 | + sels: [],//列表选中列 | ||
| 120 | + //编辑界面是否显示 | ||
| 121 | + editFormVisible: false, | ||
| 122 | + editLoading: false, | ||
| 123 | + editFormRules: { | ||
| 124 | + departmentName: [ | ||
| 125 | + { required: true, message: '请输入部门名称', trigger: 'blur' } | ||
| 126 | + ] | ||
| 127 | + }, | ||
| 128 | + //编辑界面数据 | ||
| 129 | + editForm: { | ||
| 130 | + departmentId: '', | ||
| 131 | + departmentName: '', | ||
| 132 | + companyId: '' | ||
| 133 | + }, | ||
| 134 | + //设置权限数据 | ||
| 135 | + setPermForm: {}, | ||
| 136 | + //新增界面是否显示 | ||
| 137 | + addFormVisible: false, | ||
| 138 | + //设置权限界面是否显示 | ||
| 139 | + PermFormVisible: false, | ||
| 140 | + addLoading: false, | ||
| 141 | + addFormRules: { | ||
| 142 | + departmentName: [ | ||
| 143 | + { required: true, message: '请输入部门名称', trigger: 'blur' } | ||
| 144 | + ] | ||
| 145 | + }, | ||
| 146 | + //新增界面数据 | ||
| 147 | + addForm: { | ||
| 148 | + departmentName: '', | ||
| 149 | + companyId: '' | ||
| 150 | + }, | ||
| 151 | + departmentFrom: { | ||
| 152 | + departmentId: 1, | ||
| 153 | + departmentName: '', | ||
| 154 | + departments: [] | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + } | ||
| 158 | + }, | ||
| 159 | + mounted() { | ||
| 160 | + this.getDepartments(); | ||
| 161 | + }, | ||
| 162 | + methods: { | ||
| 163 | + | ||
| 164 | + handleCurrentChange(val) { | ||
| 165 | + this.pageNum = val; | ||
| 166 | + this.getDepartments(); | ||
| 167 | + }, | ||
| 168 | + //获取列表 | ||
| 169 | + getDepartments() { | ||
| 170 | + let para = { | ||
| 171 | + pageNum: this.pageNum, | ||
| 172 | + pageSize: this.pageSize, | ||
| 173 | + departmentName: this.filters.departmentName | ||
| 174 | + }; | ||
| 175 | + this.listLoading = true; | ||
| 176 | + //NProgress.start(); | ||
| 177 | + getList(para).then((res) => { | ||
| 178 | + this.total = res.data.total; | ||
| 179 | + this.departmentList = res.data.list; | ||
| 180 | + this.listLoading = false; | ||
| 181 | + //NProgress.done(); | ||
| 182 | + }).catch((error) => { | ||
| 183 | + | ||
| 184 | + this.listLoading = false; | ||
| 185 | + if(null!= error.response && error.response!==undefined){ | ||
| 186 | + let status= error.response.status; | ||
| 187 | + let msg = error.response.statusText; | ||
| 188 | + alert(status+msg); | ||
| 189 | + }else { | ||
| 190 | + alert(error); | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + }); | ||
| 194 | + | ||
| 195 | + }, | ||
| 196 | + //获取列表 | ||
| 197 | + getCompanylists() { | ||
| 198 | + let para = { | ||
| 199 | + }; | ||
| 200 | + this.listLoading = true; | ||
| 201 | + //NProgress.start(); | ||
| 202 | + getCompanyList(para).then((res) => { | ||
| 203 | + this.total = res.data.total; | ||
| 204 | + this.companyList = res.data.list; | ||
| 205 | + this.listLoading = false; | ||
| 206 | + //NProgress.done(); | ||
| 207 | + }).catch((error) => { | ||
| 208 | + this.listLoading = false; | ||
| 209 | + if(null!= error.response && error.response!==undefined){ | ||
| 210 | + let status= error.response.status; | ||
| 211 | + let msg = error.response.statusText; | ||
| 212 | + alert(status+msg); | ||
| 213 | + }else { | ||
| 214 | + alert(error); | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + }); | ||
| 218 | + | ||
| 219 | + }, | ||
| 220 | + | ||
| 221 | + //删除 | ||
| 222 | + handleDel: function (index, row) { | ||
| 223 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 224 | + type: 'warning' | ||
| 225 | + }).then(() => { | ||
| 226 | + this.listLoading = true; | ||
| 227 | + //NProgress.start(); | ||
| 228 | + let para = { departmentId: row.departmentId }; | ||
| 229 | + remove(para).then((res) => { | ||
| 230 | + this.listLoading = false; | ||
| 231 | + //NProgress.done(); | ||
| 232 | + this.$message({ | ||
| 233 | + message: '删除成功', | ||
| 234 | + type: 'success' | ||
| 235 | + }); | ||
| 236 | + this.getDepartments(); | ||
| 237 | + }).catch((error) => { | ||
| 238 | + this.listLoading = false; | ||
| 239 | + alert(error); | ||
| 240 | + }); | ||
| 241 | + }).catch(); | ||
| 242 | + }, | ||
| 243 | + /** | ||
| 244 | + * 显示编辑界面 | ||
| 245 | + * @param index | ||
| 246 | + * @param row 为这行的数据对象 | ||
| 247 | + */ | ||
| 248 | + handleEdit: function (index, row) { | ||
| 249 | + this.editFormVisible = true; | ||
| 250 | + this.editForm = Object.assign({}, row); | ||
| 251 | + this.getCompanylists(); | ||
| 252 | + }, | ||
| 253 | + setPerm: function (index, row) { | ||
| 254 | + var _this = this; | ||
| 255 | + this.departmentIds = []; | ||
| 256 | + this.PermFormVisible = true; | ||
| 257 | + this.departmentFrom = Object.assign({}, row); | ||
| 258 | + let rolePerms = this.departmentFrom.departments; | ||
| 259 | + if (util.checkNull(rolePerms)){ | ||
| 260 | + rolePerms.forEach(function (department,v_index,v_arr) { | ||
| 261 | + if(util.checkNull(perm)){ | ||
| 262 | + _this.departmentIds[v_index] = department.departmentId; | ||
| 263 | + } | ||
| 264 | + }); | ||
| 265 | + } | ||
| 266 | + this.getPermList(); | ||
| 267 | + }, | ||
| 268 | + //显示新增界面,每次点开初始化数据 | ||
| 269 | + departmentAdd: function () { | ||
| 270 | + this.addFormVisible = true; | ||
| 271 | + this.addForm = { | ||
| 272 | + departmentName: '', | ||
| 273 | + companyId: '' | ||
| 274 | + }; | ||
| 275 | + this.getCompanylists(); | ||
| 276 | + }, | ||
| 277 | + | ||
| 278 | + //新增 | ||
| 279 | + addSubmit: function () { | ||
| 280 | + this.$refs.addForm.validate((valid) => { | ||
| 281 | + if (valid) { | ||
| 282 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 283 | + this.addLoading = true; | ||
| 284 | + //NProgress.start(); | ||
| 285 | + let para = Object.assign({}, this.addForm); | ||
| 286 | + add(para).then((res) => { | ||
| 287 | + this.addLoading = false; | ||
| 288 | + //NProgress.done(); | ||
| 289 | + this.$message({ | ||
| 290 | + message: '提交成功', | ||
| 291 | + type: 'success' | ||
| 292 | + }); | ||
| 293 | + this.$refs['addForm'].resetFields(); | ||
| 294 | + this.addFormVisible = false; | ||
| 295 | + this.getDepartments(); | ||
| 296 | + }).catch(error => alert(error)); | ||
| 297 | + }); | ||
| 298 | + } | ||
| 299 | + }); | ||
| 300 | + }, | ||
| 301 | + //编辑 | ||
| 302 | + editSubmit: function () { | ||
| 303 | + this.$refs.editForm.validate((valid) => { | ||
| 304 | + if (valid) { | ||
| 305 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 306 | + this.editLoading = true; | ||
| 307 | + let para = Object.assign({}, this.editForm); | ||
| 308 | + this.editLoading = false; | ||
| 309 | + edit(para).then((res) => { | ||
| 310 | + | ||
| 311 | + //NProgress.done(); | ||
| 312 | + this.$message({ | ||
| 313 | + message: '提交成功', | ||
| 314 | + type: 'success' | ||
| 315 | + }); | ||
| 316 | + this.$refs['editForm'].resetFields(); | ||
| 317 | + this.editFormVisible = false; | ||
| 318 | + this.getDepartments(); | ||
| 319 | + }).catch(error => alert(error)); | ||
| 320 | + }); | ||
| 321 | + } | ||
| 322 | + }); | ||
| 323 | + }, | ||
| 324 | + | ||
| 325 | + selsChange: function (sels) { | ||
| 326 | + this.sels = sels; | ||
| 327 | + }, | ||
| 328 | + //批量删除 | ||
| 329 | + batchRemove: function () { | ||
| 330 | + var ids = this.sels.map(item => item.departmentId).toString(); | ||
| 331 | + console.log(ids); | ||
| 332 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 333 | + type: 'warning' | ||
| 334 | + }).then(() => { | ||
| 335 | + this.listLoading = true; | ||
| 336 | + //NProgress.start(); | ||
| 337 | + let para = { ids: ids }; | ||
| 338 | + batchRemove(para).then((res) => { | ||
| 339 | + this.listLoading = false; | ||
| 340 | + //NProgress.done(); | ||
| 341 | + this.$message({ | ||
| 342 | + message: '删除成功', | ||
| 343 | + type: 'success' | ||
| 344 | + }); | ||
| 345 | + this.getDepartments(); | ||
| 346 | + }); | ||
| 347 | + }).catch(() => { | ||
| 348 | + | ||
| 349 | + }); | ||
| 350 | + } | ||
| 351 | + }, | ||
| 352 | + | ||
| 353 | + } | ||
| 354 | +</script> |
src/views/nav1/groupcompany.vue
0 → 100755
| 1 | +<template> | ||
| 2 | + <section> | ||
| 3 | + <!--工具条--> | ||
| 4 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
| 5 | + <el-form :inline="true" :model="filters"> | ||
| 6 | + <el-form-item> | ||
| 7 | + <el-input v-model="filters.groupName" placeholder="集团名称"></el-input> | ||
| 8 | + </el-form-item> | ||
| 9 | + <el-form-item> | ||
| 10 | + <el-button type="primary" v-on:click="getGroupCompanys()">查询</el-button> | ||
| 11 | + </el-form-item> | ||
| 12 | + <el-form-item> | ||
| 13 | + <el-button type="primary" @click="groupCompanyAdd">新增</el-button> | ||
| 14 | + </el-form-item> | ||
| 15 | + </el-form> | ||
| 16 | + </el-col> | ||
| 17 | + | ||
| 18 | + <!--列表--> | ||
| 19 | + <el-table :data="groupCompanyList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;"> | ||
| 20 | + <el-table-column type="selection" width="55"> | ||
| 21 | + </el-table-column> | ||
| 22 | + <el-table-column type="index"> | ||
| 23 | + </el-table-column> | ||
| 24 | + <el-table-column prop="groupId" label="ID" sortable> | ||
| 25 | + </el-table-column> | ||
| 26 | + <el-table-column prop="groupName" label="集团名称" sortable> | ||
| 27 | + </el-table-column> | ||
| 28 | + <el-table-column prop="creatTime" label="入库时间" sortable> | ||
| 29 | + </el-table-column> | ||
| 30 | + <el-table-column label="操作" min-width="150"> | ||
| 31 | + <template slot-scope="scope"> | ||
| 32 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
| 33 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 34 | + </template> | ||
| 35 | + </el-table-column> | ||
| 36 | + </el-table> | ||
| 37 | + | ||
| 38 | + <!--工具条--> | ||
| 39 | + <el-col :span="24" class="toolbar"> | ||
| 40 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 41 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 42 | + </el-pagination> | ||
| 43 | + </el-col> | ||
| 44 | + | ||
| 45 | + <!--编辑界面--> | ||
| 46 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 47 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 48 | + <el-form-item label="ID"> | ||
| 49 | + <span>{{editForm.groupId}}</span> | ||
| 50 | + </el-form-item> | ||
| 51 | + <el-form-item label="集团名称"> | ||
| 52 | + <el-input v-model="editForm.groupName" auto-complete="off" placeholder="请输入公司名称"></el-input> | ||
| 53 | + </el-form-item> | ||
| 54 | + </el-form> | ||
| 55 | + <div slot="footer" class="dialog-footer"> | ||
| 56 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 57 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
| 58 | + </div> | ||
| 59 | + </el-dialog> | ||
| 60 | + | ||
| 61 | + <!--新增界面--> | ||
| 62 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
| 63 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 64 | + <el-form-item label="集团名称" prop="groupId"> | ||
| 65 | + <el-input v-model="addForm.groupName" auto-complete="off" placeholder="请输入集团名称"></el-input> | ||
| 66 | + </el-form-item> | ||
| 67 | + </el-form> | ||
| 68 | + <div slot="footer" class="dialog-footer"> | ||
| 69 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 70 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 71 | + </div> | ||
| 72 | + </el-dialog> | ||
| 73 | + </section> | ||
| 74 | +</template> | ||
| 75 | + | ||
| 76 | +<script> | ||
| 77 | + import util from '../../common/js/util' | ||
| 78 | + import NProgress from 'nprogress' | ||
| 79 | + import { getList, remove, batchRemove, edit, add } from '../../api/group_company'; | ||
| 80 | + import moment from 'moment' | ||
| 81 | + | ||
| 82 | + export default { | ||
| 83 | + data() { | ||
| 84 | + return { | ||
| 85 | + filters: { | ||
| 86 | + groupName: '' | ||
| 87 | + }, | ||
| 88 | + groupCompanyList: [], | ||
| 89 | + permIds: [], | ||
| 90 | + total: 0, | ||
| 91 | + pageNum: 1, | ||
| 92 | + pageSize: 5, | ||
| 93 | + listLoading: false, | ||
| 94 | + sels: [],//列表选中列 | ||
| 95 | + //编辑界面是否显示 | ||
| 96 | + editFormVisible: false, | ||
| 97 | + editLoading: false, | ||
| 98 | + editFormRules: { | ||
| 99 | + groupName: [ | ||
| 100 | + { required: true, message: '请输入集团名称', trigger: 'blur' } | ||
| 101 | + ] | ||
| 102 | + }, | ||
| 103 | + //编辑界面数据 | ||
| 104 | + editForm: { | ||
| 105 | + groupId: '', | ||
| 106 | + groupName: '' | ||
| 107 | + }, | ||
| 108 | + //设置权限数据 | ||
| 109 | + setPermForm: {}, | ||
| 110 | + //新增界面是否显示 | ||
| 111 | + addFormVisible: false, | ||
| 112 | + //设置权限界面是否显示 | ||
| 113 | + PermFormVisible: false, | ||
| 114 | + addLoading: false, | ||
| 115 | + addFormRules: { | ||
| 116 | + groupName: [ | ||
| 117 | + { required: true, message: '请输入集团名称', trigger: 'blur' } | ||
| 118 | + ] | ||
| 119 | + }, | ||
| 120 | + //新增界面数据 | ||
| 121 | + addForm: { | ||
| 122 | + groupName: '' | ||
| 123 | + }, | ||
| 124 | + groupCompanyFrom: { | ||
| 125 | + groupId: 1, | ||
| 126 | + groupName: '', | ||
| 127 | + groupCompanys: [] | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + } | ||
| 131 | + }, | ||
| 132 | + mounted() { | ||
| 133 | + this.getGroupCompanys(); | ||
| 134 | + }, | ||
| 135 | + methods: { | ||
| 136 | + | ||
| 137 | + handleCurrentChange(val) { | ||
| 138 | + this.pageNum = val; | ||
| 139 | + this.getGroupCompanys(); | ||
| 140 | + }, | ||
| 141 | + //获取列表 | ||
| 142 | + getGroupCompanys() { | ||
| 143 | + let para = { | ||
| 144 | + pageNum: this.pageNum, | ||
| 145 | + pageSize: this.pageSize, | ||
| 146 | + groupName: this.filters.groupName | ||
| 147 | + }; | ||
| 148 | + this.listLoading = true; | ||
| 149 | + //NProgress.start(); | ||
| 150 | + getList(para).then((res) => { | ||
| 151 | + this.total = res.data.total; | ||
| 152 | + this.groupCompanyList = res.data.list; | ||
| 153 | + this.listLoading = false; | ||
| 154 | + //NProgress.done(); | ||
| 155 | + }).catch((error) => { | ||
| 156 | + | ||
| 157 | + this.listLoading = false; | ||
| 158 | + if(null!= error.response && error.response!==undefined){ | ||
| 159 | + let status= error.response.status; | ||
| 160 | + let msg = error.response.statusText; | ||
| 161 | + alert(status+msg); | ||
| 162 | + }else { | ||
| 163 | + alert(error); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + }); | ||
| 167 | + | ||
| 168 | + }, | ||
| 169 | + | ||
| 170 | + //删除 | ||
| 171 | + handleDel: function (index, row) { | ||
| 172 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 173 | + type: 'warning' | ||
| 174 | + }).then(() => { | ||
| 175 | + this.listLoading = true; | ||
| 176 | + //NProgress.start(); | ||
| 177 | + let para = { groupId: row.groupId }; | ||
| 178 | + remove(para).then((res) => { | ||
| 179 | + this.listLoading = false; | ||
| 180 | + //NProgress.done(); | ||
| 181 | + this.$message({ | ||
| 182 | + message: '删除成功', | ||
| 183 | + type: 'success' | ||
| 184 | + }); | ||
| 185 | + this.getGroupCompanys(); | ||
| 186 | + }).catch((error) => { | ||
| 187 | + this.listLoading = false; | ||
| 188 | + alert(error); | ||
| 189 | + }); | ||
| 190 | + }).catch(); | ||
| 191 | + }, | ||
| 192 | + /** | ||
| 193 | + * 显示编辑界面 | ||
| 194 | + * @param index | ||
| 195 | + * @param row 为这行的数据对象 | ||
| 196 | + */ | ||
| 197 | + handleEdit: function (index, row) { | ||
| 198 | + this.editFormVisible = true; | ||
| 199 | + this.editForm = Object.assign({}, row); | ||
| 200 | + }, | ||
| 201 | + setPerm: function (index, row) { | ||
| 202 | + var _this = this; | ||
| 203 | + this.groupIds = []; | ||
| 204 | + this.PermFormVisible = true; | ||
| 205 | + this.groupCompanyFrom = Object.assign({}, row); | ||
| 206 | + let rolePerms = this.groupCompanyFrom.groupCompanys; | ||
| 207 | + if (util.checkNull(rolePerms)){ | ||
| 208 | + rolePerms.forEach(function (group,v_index,v_arr) { | ||
| 209 | + if(util.checkNull(perm)){ | ||
| 210 | + _this.groupIds[v_index] = group.groupId; | ||
| 211 | + } | ||
| 212 | + }); | ||
| 213 | + } | ||
| 214 | + this.getPermList(); | ||
| 215 | + }, | ||
| 216 | + //显示新增界面,每次点开初始化数据 | ||
| 217 | + groupCompanyAdd: function () { | ||
| 218 | + this.addFormVisible = true; | ||
| 219 | + this.addForm = { | ||
| 220 | + groupName: '', | ||
| 221 | + companyId: '' | ||
| 222 | + }; | ||
| 223 | + }, | ||
| 224 | + | ||
| 225 | + //新增 | ||
| 226 | + addSubmit: function () { | ||
| 227 | + this.$refs.addForm.validate((valid) => { | ||
| 228 | + if (valid) { | ||
| 229 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 230 | + this.addLoading = true; | ||
| 231 | + //NProgress.start(); | ||
| 232 | + let para = Object.assign({}, this.addForm); | ||
| 233 | + add(para).then((res) => { | ||
| 234 | + this.addLoading = false; | ||
| 235 | + //NProgress.done(); | ||
| 236 | + this.$message({ | ||
| 237 | + message: '提交成功', | ||
| 238 | + type: 'success' | ||
| 239 | + }); | ||
| 240 | + this.$refs['addForm'].resetFields(); | ||
| 241 | + this.addFormVisible = false; | ||
| 242 | + this.getGroupCompanys(); | ||
| 243 | + }).catch(error => alert(error)); | ||
| 244 | + }); | ||
| 245 | + } | ||
| 246 | + }); | ||
| 247 | + }, | ||
| 248 | + //编辑 | ||
| 249 | + editSubmit: function () { | ||
| 250 | + this.$refs.editForm.validate((valid) => { | ||
| 251 | + if (valid) { | ||
| 252 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 253 | + this.editLoading = true; | ||
| 254 | + let para = Object.assign({}, this.editForm); | ||
| 255 | + this.editLoading = false; | ||
| 256 | + edit(para).then((res) => { | ||
| 257 | + | ||
| 258 | + //NProgress.done(); | ||
| 259 | + this.$message({ | ||
| 260 | + message: '提交成功', | ||
| 261 | + type: 'success' | ||
| 262 | + }); | ||
| 263 | + this.$refs['editForm'].resetFields(); | ||
| 264 | + this.editFormVisible = false; | ||
| 265 | + this.getGroupCompanys(); | ||
| 266 | + }).catch(error => alert(error)); | ||
| 267 | + }); | ||
| 268 | + } | ||
| 269 | + }); | ||
| 270 | + }, | ||
| 271 | + | ||
| 272 | + selsChange: function (sels) { | ||
| 273 | + this.sels = sels; | ||
| 274 | + }, | ||
| 275 | + //批量删除 | ||
| 276 | + batchRemove: function () { | ||
| 277 | + var ids = this.sels.map(item => item.groupId).toString(); | ||
| 278 | + console.log(ids); | ||
| 279 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 280 | + type: 'warning' | ||
| 281 | + }).then(() => { | ||
| 282 | + this.listLoading = true; | ||
| 283 | + //NProgress.start(); | ||
| 284 | + let para = { ids: ids }; | ||
| 285 | + batchRemove(para).then((res) => { | ||
| 286 | + this.listLoading = false; | ||
| 287 | + //NProgress.done(); | ||
| 288 | + this.$message({ | ||
| 289 | + message: '删除成功', | ||
| 290 | + type: 'success' | ||
| 291 | + }); | ||
| 292 | + this.getGroupCompanys(); | ||
| 293 | + }); | ||
| 294 | + }).catch(() => { | ||
| 295 | + | ||
| 296 | + }); | ||
| 297 | + } | ||
| 298 | + }, | ||
| 299 | + | ||
| 300 | + } | ||
| 301 | +</script> |
| @@ -4,10 +4,10 @@ | @@ -4,10 +4,10 @@ | ||
| 4 | <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | 4 | <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> |
| 5 | <el-form :inline="true" :model="filters"> | 5 | <el-form :inline="true" :model="filters"> |
| 6 | <el-form-item> | 6 | <el-form-item> |
| 7 | - <el-input v-model="filters.permName" placeholder="权限名称"></el-input> | 7 | + <el-input v-model="filters.name" placeholder="权限名称"></el-input> |
| 8 | </el-form-item> | 8 | </el-form-item> |
| 9 | <el-form-item> | 9 | <el-form-item> |
| 10 | - <el-button type="primary" v-on:click="getRoles()">查询</el-button> | 10 | + <el-button type="primary" v-on:click="getTableList()">查询</el-button> |
| 11 | </el-form-item> | 11 | </el-form-item> |
| 12 | <el-form-item> | 12 | <el-form-item> |
| 13 | <el-button type="primary" @click="handleAdd">新增</el-button> | 13 | <el-button type="primary" @click="handleAdd">新增</el-button> |
| @@ -23,11 +23,11 @@ | @@ -23,11 +23,11 @@ | ||
| 23 | </el-table-column> | 23 | </el-table-column> |
| 24 | <el-table-column prop="permissionId" label="ID" width="100" sortable> | 24 | <el-table-column prop="permissionId" label="ID" width="100" sortable> |
| 25 | </el-table-column> | 25 | </el-table-column> |
| 26 | - <el-table-column prop="permissionName" label="权限名称" min-width="200" sortable> | 26 | + <el-table-column prop="name" label="权限名称" min-width="200" sortable> |
| 27 | </el-table-column> | 27 | </el-table-column> |
| 28 | <el-table-column prop="description" label="描述" min-width="200" sortable> | 28 | <el-table-column prop="description" label="描述" min-width="200" sortable> |
| 29 | </el-table-column> | 29 | </el-table-column> |
| 30 | - <el-table-column prop="permissionSign" label="排序" width="100" sortable> | 30 | + <el-table-column prop="permissionOrder" label="排序" width="100" sortable> |
| 31 | </el-table-column> | 31 | </el-table-column> |
| 32 | <el-table-column prop="url" label="路径" width="100" sortable> | 32 | <el-table-column prop="url" label="路径" width="100" sortable> |
| 33 | </el-table-column> | 33 | </el-table-column> |
| @@ -42,28 +42,45 @@ | @@ -42,28 +42,45 @@ | ||
| 42 | <!--工具条--> | 42 | <!--工具条--> |
| 43 | <el-col :span="24" class="toolbar"> | 43 | <el-col :span="24" class="toolbar"> |
| 44 | <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | 44 | <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> |
| 45 | - <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | 45 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="pageSize" :total="total" style="float:right;"> |
| 46 | </el-pagination> | 46 | </el-pagination> |
| 47 | </el-col> | 47 | </el-col> |
| 48 | 48 | ||
| 49 | <!--编辑界面--> | 49 | <!--编辑界面--> |
| 50 | - <el-dialog title="编辑" v-model="editFormVisible" :close-on-click-modal="false"> | 50 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> |
| 51 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | 51 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> |
| 52 | <el-form-item label="ID"> | 52 | <el-form-item label="ID"> |
| 53 | - <span>{{editForm.roleId}}</span> | 53 | + <span>{{editForm.permissionId}}</span> |
| 54 | </el-form-item> | 54 | </el-form-item> |
| 55 | - <el-form-item label="权限名称"> | ||
| 56 | - <el-input v-model="editForm.roleName" auto-complete="off" placeholder="请输入权限名称:例如:ROLE_name"></el-input> | 55 | + <el-form-item label="权限名称" prop="name"> |
| 56 | + <el-input v-model="editForm.name" auto-complete="off" placeholder="请输入权限名称:例如:用户新增权限"></el-input> | ||
| 57 | </el-form-item> | 57 | </el-form-item> |
| 58 | - <el-form-item label="权限描述"> | 58 | + <el-form-item label="权限描述" prop="description"> |
| 59 | <el-input v-model="editForm.description" auto-complete="off" placeholder="请输入权限描述:例如:用户管理员"></el-input> | 59 | <el-input v-model="editForm.description" auto-complete="off" placeholder="请输入权限描述:例如:用户管理员"></el-input> |
| 60 | </el-form-item> | 60 | </el-form-item> |
| 61 | - <el-form-item label="权限排序"> | ||
| 62 | - <el-input v-model="editForm.roleSign" auto-complete="off" placeholder="请输入权限排序:例如:数字123"></el-input> | 61 | + <el-form-item label="权限总路径" prop="path"> |
| 62 | + <el-input v-model="editForm.path" auto-complete="off" placeholder="请输入父目录ID:例如:123"></el-input> | ||
| 63 | + </el-form-item> | ||
| 64 | + <el-form-item label="权限路径" prop="url"> | ||
| 65 | + <el-input v-model="editForm.url" auto-complete="off" placeholder="请输入权限描述:例如:/user/update"></el-input> | ||
| 66 | + </el-form-item> | ||
| 67 | + <el-form-item label="权限排序" prop="permissionOrder"> | ||
| 68 | + <el-input v-model="editForm.permissionOrder" auto-complete="off" placeholder="请输入权限排序:例如:123"></el-input> | ||
| 69 | + </el-form-item> | ||
| 70 | + <el-form-item label="父目录ID" prop="parentId"> | ||
| 71 | + <el-input v-model="editForm.parentId" auto-complete="off" placeholder="请输入父目录ID:例如:123"></el-input> | ||
| 72 | + </el-form-item> | ||
| 73 | + <el-form-item label="ismenu" prop="ismenu"> | ||
| 74 | + <el-switch | ||
| 75 | + v-model="editForm.ismenu" | ||
| 76 | + active-color="#13ce66" | ||
| 77 | + inactive-color="#ff4949" | ||
| 78 | + active-text="是" | ||
| 79 | + inactive-text="否" | ||
| 80 | + active-value="1" | ||
| 81 | + inactive-value="0"> | ||
| 82 | + </el-switch> | ||
| 63 | </el-form-item> | 83 | </el-form-item> |
| 64 | - <!--<el-form-item label="创建日期">--> | ||
| 65 | - <!--<el-date-picker type="date" placeholder="创建日期" v-model="editForm.creattime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"></el-date-picker>--> | ||
| 66 | - <!--</el-form-item>--> | ||
| 67 | </el-form> | 84 | </el-form> |
| 68 | <div slot="footer" class="dialog-footer"> | 85 | <div slot="footer" class="dialog-footer"> |
| 69 | <el-button @click.native="editFormVisible = false">取消</el-button> | 86 | <el-button @click.native="editFormVisible = false">取消</el-button> |
| @@ -72,25 +89,36 @@ | @@ -72,25 +89,36 @@ | ||
| 72 | </el-dialog> | 89 | </el-dialog> |
| 73 | 90 | ||
| 74 | <!--新增界面--> | 91 | <!--新增界面--> |
| 75 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 92 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 76 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 93 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 77 | - <el-form-item label="权限名称" prop="permissionName"> | ||
| 78 | - <el-input v-model="addForm.roleName" auto-complete="off" placeholder="请输入权限名称:例如:用户新增权限"></el-input> | 94 | + <el-form-item label="权限名称" prop="name"> |
| 95 | + <el-input v-model="addForm.name" auto-complete="off" placeholder="请输入权限名称:例如:用户新增权限"></el-input> | ||
| 79 | </el-form-item> | 96 | </el-form-item> |
| 80 | <el-form-item label="权限描述" prop="description"> | 97 | <el-form-item label="权限描述" prop="description"> |
| 81 | <el-input v-model="addForm.description" auto-complete="off" placeholder="请输入权限描述:例如:用户管理员"></el-input> | 98 | <el-input v-model="addForm.description" auto-complete="off" placeholder="请输入权限描述:例如:用户管理员"></el-input> |
| 82 | </el-form-item> | 99 | </el-form-item> |
| 100 | + <el-form-item label="权限总路径" prop="path"> | ||
| 101 | + <el-input v-model="addForm.path" auto-complete="off" placeholder="请输入父目录ID:例如:123"></el-input> | ||
| 102 | + </el-form-item> | ||
| 83 | <el-form-item label="权限路径" prop="url"> | 103 | <el-form-item label="权限路径" prop="url"> |
| 84 | <el-input v-model="addForm.url" auto-complete="off" placeholder="请输入权限描述:例如:/user/update"></el-input> | 104 | <el-input v-model="addForm.url" auto-complete="off" placeholder="请输入权限描述:例如:/user/update"></el-input> |
| 85 | </el-form-item> | 105 | </el-form-item> |
| 86 | - <el-form-item label="权限排序" prop="permissionSign"> | ||
| 87 | - <el-input v-model="addForm.permissionSign" auto-complete="off" placeholder="请输入权限排序:例如:123"></el-input> | 106 | + <el-form-item label="权限排序" prop="permissionOrder"> |
| 107 | + <el-input v-model="addForm.permissionOrder" auto-complete="off" placeholder="请输入权限排序:例如:123"></el-input> | ||
| 88 | </el-form-item> | 108 | </el-form-item> |
| 89 | <el-form-item label="父目录ID" prop="parentId"> | 109 | <el-form-item label="父目录ID" prop="parentId"> |
| 90 | <el-input v-model="addForm.parentId" auto-complete="off" placeholder="请输入父目录ID:例如:123"></el-input> | 110 | <el-input v-model="addForm.parentId" auto-complete="off" placeholder="请输入父目录ID:例如:123"></el-input> |
| 91 | </el-form-item> | 111 | </el-form-item> |
| 92 | - <el-form-item label="父目录ID" prop="parentId"> | ||
| 93 | - <el-input v-model="addForm.parentId" auto-complete="off" placeholder="请输入父目录ID:例如:123"></el-input> | 112 | + <el-form-item label="ismenu" prop="ismenu"> |
| 113 | + <el-switch | ||
| 114 | + v-model="addForm.ismenu" | ||
| 115 | + active-color="#13ce66" | ||
| 116 | + inactive-color="#ff4949" | ||
| 117 | + active-text="是" | ||
| 118 | + inactive-text="否" | ||
| 119 | + active-value="1" | ||
| 120 | + inactive-value="0"> | ||
| 121 | + </el-switch> | ||
| 94 | </el-form-item> | 122 | </el-form-item> |
| 95 | </el-form> | 123 | </el-form> |
| 96 | <div slot="footer" class="dialog-footer"> | 124 | <div slot="footer" class="dialog-footer"> |
| @@ -110,12 +138,12 @@ | @@ -110,12 +138,12 @@ | ||
| 110 | data() { | 138 | data() { |
| 111 | return { | 139 | return { |
| 112 | filters: { | 140 | filters: { |
| 113 | - permName: '' | 141 | + name: '' |
| 114 | }, | 142 | }, |
| 115 | tableList: [], | 143 | tableList: [], |
| 116 | total: 0, | 144 | total: 0, |
| 117 | pageNum: 1, | 145 | pageNum: 1, |
| 118 | - pageSize: 5, | 146 | + pageSize: 10, |
| 119 | listLoading: false, | 147 | listLoading: false, |
| 120 | sels: [],//列表选中列 | 148 | sels: [],//列表选中列 |
| 121 | //编辑界面是否显示 | 149 | //编辑界面是否显示 |
| @@ -128,27 +156,48 @@ | @@ -128,27 +156,48 @@ | ||
| 128 | }, | 156 | }, |
| 129 | //编辑界面数据 | 157 | //编辑界面数据 |
| 130 | editForm: { | 158 | editForm: { |
| 131 | - roleId: 1, | 159 | + permissionId:'', |
| 132 | description: '', | 160 | description: '', |
| 133 | - roleName: '', | ||
| 134 | - roleSign: 1 | 161 | + name: '', |
| 162 | + url: '', | ||
| 163 | + path: '', | ||
| 164 | + parentId: '', | ||
| 165 | + ismenu: '', | ||
| 166 | + permissionOrder:'' | ||
| 135 | }, | 167 | }, |
| 136 | 168 | ||
| 137 | addFormVisible: false,//新增界面是否显示 | 169 | addFormVisible: false,//新增界面是否显示 |
| 138 | addLoading: false, | 170 | addLoading: false, |
| 139 | addFormRules: { | 171 | addFormRules: { |
| 140 | - roleName: [ | 172 | + name: [ |
| 141 | { required: true, message: '请输入权限名称', trigger: 'blur' } | 173 | { required: true, message: '请输入权限名称', trigger: 'blur' } |
| 142 | ], | 174 | ], |
| 143 | description: [ | 175 | description: [ |
| 144 | { required: true, message: '请输入权限描述', trigger: 'blur' } | 176 | { required: true, message: '请输入权限描述', trigger: 'blur' } |
| 145 | - ] | 177 | + ], |
| 178 | + paht: [ | ||
| 179 | + { required: true, message: '请输入总路径', trigger: 'blur' } | ||
| 180 | + ], | ||
| 181 | + url: [ | ||
| 182 | + { required: true, message: '请输入权限路径', trigger: 'blur' } | ||
| 183 | + ], | ||
| 184 | + permissionOrder: [ | ||
| 185 | + { required: true, message: '请输入排序字段', trigger: 'blur' } | ||
| 186 | + ], | ||
| 187 | + parentId: [ | ||
| 188 | + { required: true, message: '请输入父类ID', trigger: 'blur' } | ||
| 189 | + ] | ||
| 146 | }, | 190 | }, |
| 147 | //新增界面数据 | 191 | //新增界面数据 |
| 148 | addForm: { | 192 | addForm: { |
| 149 | description: '', | 193 | description: '', |
| 150 | - roleName: '', | ||
| 151 | - roleSign: 1 | 194 | + name: '', |
| 195 | + url: '', | ||
| 196 | + path: '', | ||
| 197 | + parentId: '', | ||
| 198 | + ismenu: '', | ||
| 199 | + permissionOrder:'' | ||
| 200 | + | ||
| 152 | } | 201 | } |
| 153 | 202 | ||
| 154 | } | 203 | } |
| @@ -170,7 +219,7 @@ | @@ -170,7 +219,7 @@ | ||
| 170 | let para = { | 219 | let para = { |
| 171 | pageNum: this.pageNum, | 220 | pageNum: this.pageNum, |
| 172 | pageSize: this.pageSize, | 221 | pageSize: this.pageSize, |
| 173 | - name: this.filters.permName | 222 | + name: this.filters.name |
| 174 | }; | 223 | }; |
| 175 | this.listLoading = true; | 224 | this.listLoading = true; |
| 176 | //NProgress.start(); | 225 | //NProgress.start(); |
| @@ -202,7 +251,7 @@ | @@ -202,7 +251,7 @@ | ||
| 202 | }).then(() => { | 251 | }).then(() => { |
| 203 | this.listLoading = true; | 252 | this.listLoading = true; |
| 204 | //NProgress.start(); | 253 | //NProgress.start(); |
| 205 | - let para = { userId: row.userId }; | 254 | + let para = { permissionId: row.permissionId }; |
| 206 | remove(para).then((res) => { | 255 | remove(para).then((res) => { |
| 207 | this.listLoading = false; | 256 | this.listLoading = false; |
| 208 | //NProgress.done(); | 257 | //NProgress.done(); |
| @@ -210,7 +259,7 @@ | @@ -210,7 +259,7 @@ | ||
| 210 | message: '删除成功', | 259 | message: '删除成功', |
| 211 | type: 'success' | 260 | type: 'success' |
| 212 | }); | 261 | }); |
| 213 | - this.getRoles(); | 262 | + this.getTableList(); |
| 214 | }).catch((error) => { | 263 | }).catch((error) => { |
| 215 | this.listLoading = false; | 264 | this.listLoading = false; |
| 216 | alert(error); | 265 | alert(error); |
| @@ -248,18 +297,6 @@ | @@ -248,18 +297,6 @@ | ||
| 248 | this.editLoading = true; | 297 | this.editLoading = true; |
| 249 | //NProgress.start(); | 298 | //NProgress.start(); |
| 250 | let para = Object.assign({}, this.editForm); | 299 | let para = Object.assign({}, this.editForm); |
| 251 | - //不需要提交的 去掉,后端不好接收 | ||
| 252 | - para.authorities = null; | ||
| 253 | - para.permissions = null; | ||
| 254 | - para.roles = null; | ||
| 255 | -// para.birth = (!para.birth || para.birth == '') ? '' : util.formatDate.format(new Date(para.birth), 'yyyy-MM-dd'); | ||
| 256 | - /* | ||
| 257 | - 查询之后格式this.filters.column.create_start_date中日期发生变化; | ||
| 258 | - Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) 变成了 "2017-08-08T16:00:00.000Z"; | ||
| 259 | - 所以使用 moment 日期格式化插件将时间转换成 [ Wed Aug 09 2017 00:00:00 GMT+0800 (中国标准时间) ] 格 | ||
| 260 | - 式; | ||
| 261 | - */ | ||
| 262 | - /*moment 安装 npm install moment --save*/ | ||
| 263 | para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss'); | 300 | para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss'); |
| 264 | this.editLoading = false; | 301 | this.editLoading = false; |
| 265 | edit(para).then((res) => { | 302 | edit(para).then((res) => { |
| @@ -271,7 +308,7 @@ | @@ -271,7 +308,7 @@ | ||
| 271 | }); | 308 | }); |
| 272 | this.$refs['editForm'].resetFields(); | 309 | this.$refs['editForm'].resetFields(); |
| 273 | this.editFormVisible = false; | 310 | this.editFormVisible = false; |
| 274 | - this.getRoles(); | 311 | + this.getTableList(); |
| 275 | }).catch(error => alert(error)); | 312 | }).catch(error => alert(error)); |
| 276 | }); | 313 | }); |
| 277 | } | 314 | } |
| @@ -295,7 +332,7 @@ | @@ -295,7 +332,7 @@ | ||
| 295 | }); | 332 | }); |
| 296 | this.$refs['addForm'].resetFields(); | 333 | this.$refs['addForm'].resetFields(); |
| 297 | this.addFormVisible = false; | 334 | this.addFormVisible = false; |
| 298 | - this.getRoles(); | 335 | + this.getTableList(); |
| 299 | }).catch(error => alert(error)); | 336 | }).catch(error => alert(error)); |
| 300 | }); | 337 | }); |
| 301 | } | 338 | } |
| @@ -306,7 +343,7 @@ | @@ -306,7 +343,7 @@ | ||
| 306 | }, | 343 | }, |
| 307 | //批量删除 | 344 | //批量删除 |
| 308 | batchRemove: function () { | 345 | batchRemove: function () { |
| 309 | - var ids = this.sels.map(item => item.id).toString(); | 346 | + var ids = this.sels.map(item => item.permissionId).toString(); |
| 310 | this.$confirm('确认删除选中记录吗?', '提示', { | 347 | this.$confirm('确认删除选中记录吗?', '提示', { |
| 311 | type: 'warning' | 348 | type: 'warning' |
| 312 | }).then(() => { | 349 | }).then(() => { |
| @@ -320,7 +357,7 @@ | @@ -320,7 +357,7 @@ | ||
| 320 | message: '删除成功', | 357 | message: '删除成功', |
| 321 | type: 'success' | 358 | type: 'success' |
| 322 | }); | 359 | }); |
| 323 | - this.getRoles(); | 360 | + this.getTableList(); |
| 324 | }); | 361 | }); |
| 325 | }).catch(() => { | 362 | }).catch(() => { |
| 326 | 363 |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | 4 | <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> |
| 5 | <el-form :inline="true" :model="filters"> | 5 | <el-form :inline="true" :model="filters"> |
| 6 | <el-form-item> | 6 | <el-form-item> |
| 7 | - <el-input v-model="filters.roleName" placeholder="角色名称"></el-input> | 7 | + <el-input v-model="filters.roleName" placeholder="岗位/角色名称"></el-input> |
| 8 | </el-form-item> | 8 | </el-form-item> |
| 9 | <el-form-item> | 9 | <el-form-item> |
| 10 | <el-button type="primary" v-on:click="getRoles()">查询</el-button> | 10 | <el-button type="primary" v-on:click="getRoles()">查询</el-button> |
| @@ -23,11 +23,11 @@ | @@ -23,11 +23,11 @@ | ||
| 23 | </el-table-column> | 23 | </el-table-column> |
| 24 | <el-table-column prop="roleId" label="ID" width="100" sortable> | 24 | <el-table-column prop="roleId" label="ID" width="100" sortable> |
| 25 | </el-table-column> | 25 | </el-table-column> |
| 26 | - <el-table-column prop="roleName" label="角色名称" min-width="200" sortable> | 26 | + <el-table-column prop="roleName" label="岗位/角色名称" min-width="200" sortable> |
| 27 | </el-table-column> | 27 | </el-table-column> |
| 28 | - <el-table-column prop="description" label="角色描述" min-width="200" sortable> | 28 | + <el-table-column prop="departmentName" label="部门名称" min-width="200" sortable> |
| 29 | </el-table-column> | 29 | </el-table-column> |
| 30 | - <el-table-column prop="roleSign" label="排序" width="100" sortable> | 30 | + <el-table-column prop="description" label="岗位/角色描述" min-width="200" sortable> |
| 31 | </el-table-column> | 31 | </el-table-column> |
| 32 | <el-table-column label="操作" min-width="260"> | 32 | <el-table-column label="操作" min-width="260"> |
| 33 | <template slot-scope="scope"> | 33 | <template slot-scope="scope"> |
| @@ -41,28 +41,32 @@ | @@ -41,28 +41,32 @@ | ||
| 41 | <!--工具条--> | 41 | <!--工具条--> |
| 42 | <el-col :span="24" class="toolbar"> | 42 | <el-col :span="24" class="toolbar"> |
| 43 | <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | 43 | <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> |
| 44 | - <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | 44 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> |
| 45 | </el-pagination> | 45 | </el-pagination> |
| 46 | </el-col> | 46 | </el-col> |
| 47 | 47 | ||
| 48 | <!--编辑界面--> | 48 | <!--编辑界面--> |
| 49 | - <el-dialog title="编辑" v-model="editFormVisible" :close-on-click-modal="false"> | 49 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> |
| 50 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | 50 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> |
| 51 | <el-form-item label="ID"> | 51 | <el-form-item label="ID"> |
| 52 | <span>{{editForm.roleId}}</span> | 52 | <span>{{editForm.roleId}}</span> |
| 53 | </el-form-item> | 53 | </el-form-item> |
| 54 | - <el-form-item label="角色名称"> | ||
| 55 | - <el-input v-model="editForm.roleName" auto-complete="off" placeholder="请输入角色名称:例如:ROLE_name"></el-input> | 54 | + <el-form-item label="岗位名称"> |
| 55 | + <el-input v-model="editForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input> | ||
| 56 | </el-form-item> | 56 | </el-form-item> |
| 57 | - <el-form-item label="角色描述"> | ||
| 58 | - <el-input v-model="editForm.description" auto-complete="off" placeholder="请输入角色描述:例如:用户管理员"></el-input> | 57 | + <el-form-item label="岗位描述"> |
| 58 | + <el-input v-model="editForm.description" auto-complete="off" placeholder="请输入岗位/角色描述:例如:用户管理员"></el-input> | ||
| 59 | </el-form-item> | 59 | </el-form-item> |
| 60 | - <el-form-item label="角色排序"> | ||
| 61 | - <el-input v-model="editForm.roleSign" auto-complete="off" placeholder="请输入角色排序:例如:数字123"></el-input> | 60 | + <el-form-item label="部门名称"> |
| 61 | + <el-select v-model="editForm.departmentId" placeholder="请选择"> | ||
| 62 | + <el-option | ||
| 63 | + v-for="item in departmentNameList" | ||
| 64 | + :key="item.departmentId" | ||
| 65 | + :label="item.departmentName" | ||
| 66 | + :value="item.departmentId"> | ||
| 67 | + </el-option> | ||
| 68 | + </el-select> | ||
| 62 | </el-form-item> | 69 | </el-form-item> |
| 63 | - <!--<el-form-item label="创建日期">--> | ||
| 64 | - <!--<el-date-picker type="date" placeholder="创建日期" v-model="editForm.creattime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"></el-date-picker>--> | ||
| 65 | - <!--</el-form-item>--> | ||
| 66 | </el-form> | 70 | </el-form> |
| 67 | <div slot="footer" class="dialog-footer"> | 71 | <div slot="footer" class="dialog-footer"> |
| 68 | <el-button @click.native="editFormVisible = false">取消</el-button> | 72 | <el-button @click.native="editFormVisible = false">取消</el-button> |
| @@ -71,16 +75,23 @@ | @@ -71,16 +75,23 @@ | ||
| 71 | </el-dialog> | 75 | </el-dialog> |
| 72 | 76 | ||
| 73 | <!--新增界面--> | 77 | <!--新增界面--> |
| 74 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 78 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 75 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 79 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 76 | - <el-form-item label="角色名称" prop="roleName"> | ||
| 77 | - <el-input v-model="addForm.roleName" auto-complete="off" placeholder="请输入角色名称:例如:ROLE_name"></el-input> | 80 | + <el-form-item label="岗位/角色名称" prop="roleName"> |
| 81 | + <el-input v-model="addForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input> | ||
| 78 | </el-form-item> | 82 | </el-form-item> |
| 79 | - <el-form-item label="角色描述" prop="description"> | ||
| 80 | - <el-input v-model="addForm.description" auto-complete="off" placeholder="请输入角色描述:例如:用户管理员"></el-input> | 83 | + <el-form-item label="岗位/角色描述" prop="description"> |
| 84 | + <el-input v-model="addForm.description" auto-complete="off" placeholder="请输入岗位/角色描述:例如:用户管理员"></el-input> | ||
| 81 | </el-form-item> | 85 | </el-form-item> |
| 82 | - <el-form-item label="角色排序" prop="roleSign"> | ||
| 83 | - <el-input v-model="addForm.roleSign" auto-complete="off" placeholder="请输入角色排序:例如:数字123"></el-input> | 86 | + <el-form-item label="部门名称" prop="roleSign"> |
| 87 | + <el-select v-model="addForm.departmentId" placeholder="请选择"> | ||
| 88 | + <el-option | ||
| 89 | + v-for="item in departmentNameList" | ||
| 90 | + :key="item.departmentId" | ||
| 91 | + :label="item.departmentName" | ||
| 92 | + :value="item.departmentId"> | ||
| 93 | + </el-option> | ||
| 94 | + </el-select> | ||
| 84 | </el-form-item> | 95 | </el-form-item> |
| 85 | </el-form> | 96 | </el-form> |
| 86 | <div slot="footer" class="dialog-footer"> | 97 | <div slot="footer" class="dialog-footer"> |
| @@ -90,7 +101,7 @@ | @@ -90,7 +101,7 @@ | ||
| 90 | </el-dialog> | 101 | </el-dialog> |
| 91 | 102 | ||
| 92 | <!--权限设置界面--> | 103 | <!--权限设置界面--> |
| 93 | - <el-dialog title="角色的权限设置" v-model="PermFormVisible" :close-on-click-modal="false"> | 104 | + <el-dialog title="岗位的权限设置" :visible.sync="PermFormVisible" :close-on-click-modal="false"> |
| 94 | <el-form :model="permForm" label-width="80px" ref="permForm"> | 105 | <el-form :model="permForm" label-width="80px" ref="permForm"> |
| 95 | <el-checkbox-group v-model="permIds" size="small"> | 106 | <el-checkbox-group v-model="permIds" size="small"> |
| 96 | <el-checkbox v-for="perm in permissons" :label="perm.permissionId" :key="perm.permissionId">{{perm.name}}</el-checkbox> | 107 | <el-checkbox v-for="perm in permissons" :label="perm.permissionId" :key="perm.permissionId">{{perm.name}}</el-checkbox> |
| @@ -108,6 +119,7 @@ | @@ -108,6 +119,7 @@ | ||
| 108 | import util from '../../common/js/util' | 119 | import util from '../../common/js/util' |
| 109 | import NProgress from 'nprogress' | 120 | import NProgress from 'nprogress' |
| 110 | import { getList, remove, batchRemove, edit, add, updateRolePerm } from '../../api/role_api'; | 121 | import { getList, remove, batchRemove, edit, add, updateRolePerm } from '../../api/role_api'; |
| 122 | + import { getList as getDepartmentList} from '../../api/department'; | ||
| 111 | import { getList as permList } from '../../api/perm_api'; | 123 | import { getList as permList } from '../../api/perm_api'; |
| 112 | import moment from 'moment' | 124 | import moment from 'moment' |
| 113 | export default { | 125 | export default { |
| @@ -116,6 +128,7 @@ | @@ -116,6 +128,7 @@ | ||
| 116 | filters: { | 128 | filters: { |
| 117 | roleName: '' | 129 | roleName: '' |
| 118 | }, | 130 | }, |
| 131 | + departmentNameList:[], | ||
| 119 | roles: [], | 132 | roles: [], |
| 120 | permissons: [], | 133 | permissons: [], |
| 121 | permIds: [], | 134 | permIds: [], |
| @@ -129,7 +142,7 @@ | @@ -129,7 +142,7 @@ | ||
| 129 | editLoading: false, | 142 | editLoading: false, |
| 130 | editFormRules: { | 143 | editFormRules: { |
| 131 | roleName: [ | 144 | roleName: [ |
| 132 | - { required: true, message: '请输入角色名称', trigger: 'blur' } | 145 | + { required: true, message: '请输入岗位/角色名称', trigger: 'blur' } |
| 133 | ] | 146 | ] |
| 134 | }, | 147 | }, |
| 135 | //编辑界面数据 | 148 | //编辑界面数据 |
| @@ -137,10 +150,10 @@ | @@ -137,10 +150,10 @@ | ||
| 137 | roleId: 1, | 150 | roleId: 1, |
| 138 | description: '', | 151 | description: '', |
| 139 | roleName: '', | 152 | roleName: '', |
| 140 | - roleSign: 1 | 153 | + roleSign: 1, |
| 154 | + departmentId:'' | ||
| 141 | }, | 155 | }, |
| 142 | - //设置权限数据 | ||
| 143 | - setPermForm: {}, | 156 | + |
| 144 | //新增界面是否显示 | 157 | //新增界面是否显示 |
| 145 | addFormVisible: false, | 158 | addFormVisible: false, |
| 146 | //设置权限界面是否显示 | 159 | //设置权限界面是否显示 |
| @@ -148,17 +161,18 @@ | @@ -148,17 +161,18 @@ | ||
| 148 | addLoading: false, | 161 | addLoading: false, |
| 149 | addFormRules: { | 162 | addFormRules: { |
| 150 | roleName: [ | 163 | roleName: [ |
| 151 | - { required: true, message: '请输入角色名称', trigger: 'blur' } | 164 | + { required: true, message: '请输入岗位/角色名称', trigger: 'blur' } |
| 152 | ], | 165 | ], |
| 153 | description: [ | 166 | description: [ |
| 154 | - { required: true, message: '请输入角色描述', trigger: 'blur' } | 167 | + { required: true, message: '请输入岗位/角色描述', trigger: 'blur' } |
| 155 | ] | 168 | ] |
| 156 | }, | 169 | }, |
| 157 | //新增界面数据 | 170 | //新增界面数据 |
| 158 | addForm: { | 171 | addForm: { |
| 159 | description: '', | 172 | description: '', |
| 160 | roleName: '', | 173 | roleName: '', |
| 161 | - roleSign: 1 | 174 | + roleSign: 1, |
| 175 | + departmentId:'' | ||
| 162 | }, | 176 | }, |
| 163 | permForm: { | 177 | permForm: { |
| 164 | roleId: 1, | 178 | roleId: 1, |
| @@ -207,11 +221,36 @@ | @@ -207,11 +221,36 @@ | ||
| 207 | alert(error); | 221 | alert(error); |
| 208 | } | 222 | } |
| 209 | 223 | ||
| 210 | - | ||
| 211 | - | ||
| 212 | }); | 224 | }); |
| 213 | 225 | ||
| 214 | }, | 226 | }, |
| 227 | + | ||
| 228 | + | ||
| 229 | + //获取部门列表 | ||
| 230 | + getdepartmentNames() { | ||
| 231 | + | ||
| 232 | + this.listLoading = true; | ||
| 233 | + //NProgress.start(); | ||
| 234 | + getDepartmentList().then((res) => { | ||
| 235 | + this.total = res.data.total; | ||
| 236 | + this.departmentNameList = res.data.list; | ||
| 237 | + this.listLoading = false; | ||
| 238 | + //NProgress.done(); | ||
| 239 | + }).catch((error) => { | ||
| 240 | + | ||
| 241 | + this.listLoading = false; | ||
| 242 | + if(null!= error.response && error.response!==undefined){ | ||
| 243 | + let status= error.response.status; | ||
| 244 | + let msg = error.response.statusText; | ||
| 245 | + alert(status+msg); | ||
| 246 | + }else { | ||
| 247 | + alert(error); | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + }); | ||
| 251 | + | ||
| 252 | + }, | ||
| 253 | + | ||
| 215 | //获取权限列表 | 254 | //获取权限列表 |
| 216 | getPermList() { | 255 | getPermList() { |
| 217 | let para = { | 256 | let para = { |
| @@ -240,7 +279,7 @@ | @@ -240,7 +279,7 @@ | ||
| 240 | }).then(() => { | 279 | }).then(() => { |
| 241 | this.listLoading = true; | 280 | this.listLoading = true; |
| 242 | //NProgress.start(); | 281 | //NProgress.start(); |
| 243 | - let para = { userId: row.userId }; | 282 | + let para = { roleId: row.roleId }; |
| 244 | remove(para).then((res) => { | 283 | remove(para).then((res) => { |
| 245 | this.listLoading = false; | 284 | this.listLoading = false; |
| 246 | //NProgress.done(); | 285 | //NProgress.done(); |
| @@ -263,6 +302,7 @@ | @@ -263,6 +302,7 @@ | ||
| 263 | handleEdit: function (index, row) { | 302 | handleEdit: function (index, row) { |
| 264 | this.editFormVisible = true; | 303 | this.editFormVisible = true; |
| 265 | this.editForm = Object.assign({}, row); | 304 | this.editForm = Object.assign({}, row); |
| 305 | + this.getdepartmentNames(); | ||
| 266 | }, | 306 | }, |
| 267 | setPerm: function (index, row) { | 307 | setPerm: function (index, row) { |
| 268 | var _this = this; | 308 | var _this = this; |
| @@ -292,6 +332,7 @@ | @@ -292,6 +332,7 @@ | ||
| 292 | mobilephone: '', | 332 | mobilephone: '', |
| 293 | age: 1 | 333 | age: 1 |
| 294 | }; | 334 | }; |
| 335 | + this.getdepartmentNames(); | ||
| 295 | }, | 336 | }, |
| 296 | //编辑 | 337 | //编辑 |
| 297 | editSubmit: function () { | 338 | editSubmit: function () { |
| @@ -386,7 +427,7 @@ | @@ -386,7 +427,7 @@ | ||
| 386 | }, | 427 | }, |
| 387 | //批量删除 | 428 | //批量删除 |
| 388 | batchRemove: function () { | 429 | batchRemove: function () { |
| 389 | - var ids = this.sels.map(item => item.id).toString(); | 430 | + var ids = this.sels.map(item => item.roleId).toString(); |
| 390 | this.$confirm('确认删除选中记录吗?', '提示', { | 431 | this.$confirm('确认删除选中记录吗?', '提示', { |
| 391 | type: 'warning' | 432 | type: 'warning' |
| 392 | }).then(() => { | 433 | }).then(() => { |
| @@ -4,10 +4,10 @@ | @@ -4,10 +4,10 @@ | ||
| 4 | <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | 4 | <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> |
| 5 | <el-form :inline="true" :model="filters"> | 5 | <el-form :inline="true" :model="filters"> |
| 6 | <el-form-item> | 6 | <el-form-item> |
| 7 | - <el-input v-model="filters.realname" placeholder="姓名"></el-input> | 7 | + <el-input v-model="filters.realName" placeholder="姓名"></el-input> |
| 8 | </el-form-item> | 8 | </el-form-item> |
| 9 | <el-form-item> | 9 | <el-form-item> |
| 10 | - <el-input v-model="filters.username" placeholder="账号"></el-input> | 10 | + <el-input v-model="filters.userName" placeholder="账号"></el-input> |
| 11 | </el-form-item> | 11 | </el-form-item> |
| 12 | <el-form-item> | 12 | <el-form-item> |
| 13 | <el-button type="primary" v-on:click="getUsers">查询</el-button> | 13 | <el-button type="primary" v-on:click="getUsers">查询</el-button> |
| @@ -56,12 +56,12 @@ | @@ -56,12 +56,12 @@ | ||
| 56 | <!--工具条--> | 56 | <!--工具条--> |
| 57 | <el-col :span="24" class="toolbar"> | 57 | <el-col :span="24" class="toolbar"> |
| 58 | <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | 58 | <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> |
| 59 | - <el-pagination layout="prev, pager, next" @current-change="handleCurrentChange" :page-size="10" :total="total" style="float:right;"> | 59 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="10" :total="total" style="float:right;"> |
| 60 | </el-pagination> | 60 | </el-pagination> |
| 61 | </el-col> | 61 | </el-col> |
| 62 | 62 | ||
| 63 | <!--编辑界面--> | 63 | <!--编辑界面--> |
| 64 | - <el-dialog title="编辑" v-model="editFormVisible" :close-on-click-modal="false"> | 64 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> |
| 65 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | 65 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> |
| 66 | <el-form-item label="ID"> | 66 | <el-form-item label="ID"> |
| 67 | <span>{{editForm.userId}}</span> | 67 | <span>{{editForm.userId}}</span> |
| @@ -123,7 +123,7 @@ | @@ -123,7 +123,7 @@ | ||
| 123 | </el-dialog> | 123 | </el-dialog> |
| 124 | 124 | ||
| 125 | <!--新增界面--> | 125 | <!--新增界面--> |
| 126 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 126 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 127 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 127 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 128 | <el-form-item label="账号" prop="username"> | 128 | <el-form-item label="账号" prop="username"> |
| 129 | <el-input v-model="addForm.username"></el-input> | 129 | <el-input v-model="addForm.username"></el-input> |
| @@ -160,7 +160,7 @@ | @@ -160,7 +160,7 @@ | ||
| 160 | </el-dialog> | 160 | </el-dialog> |
| 161 | 161 | ||
| 162 | <!--权限设置--> | 162 | <!--权限设置--> |
| 163 | - <el-dialog title="权限设置" v-model="roleFormVisible" :close-on-click-modal="false"> | 163 | + <el-dialog title="权限设置" :visible.sync="roleFormVisible" :close-on-click-modal="false"> |
| 164 | <el-form :model="roleEditForm" label-width="80px" ref="roleEditForm" > | 164 | <el-form :model="roleEditForm" label-width="80px" ref="roleEditForm" > |
| 165 | <el-form-item label="ID"> | 165 | <el-form-item label="ID"> |
| 166 | <span>{{roleEditForm.userId}}</span> | 166 | <span>{{roleEditForm.userId}}</span> |
| @@ -168,9 +168,9 @@ | @@ -168,9 +168,9 @@ | ||
| 168 | <el-form-item label="账号"> | 168 | <el-form-item label="账号"> |
| 169 | <span>{{roleEditForm.username}}</span> | 169 | <span>{{roleEditForm.username}}</span> |
| 170 | </el-form-item> | 170 | </el-form-item> |
| 171 | - <el-checkbox-group v-model="roleIds" size="small"> | ||
| 172 | - <el-checkbox-button v-for="role in roles" :label="role.roleId" :key="role.roleId" >{{role.description}}</el-checkbox-button> | ||
| 173 | - </el-checkbox-group> | 171 | + <el-checkbox-group v-model="roleIds" size="small"> |
| 172 | + <el-checkbox-button v-for="role in roles" :label="role.roleId" :key="role.roleId" >{{role.description}}</el-checkbox-button> | ||
| 173 | + </el-checkbox-group> | ||
| 174 | </el-form> | 174 | </el-form> |
| 175 | <div slot="footer" class="dialog-footer"> | 175 | <div slot="footer" class="dialog-footer"> |
| 176 | <el-button @click.native="roleFormVisible = false">取消</el-button> | 176 | <el-button @click.native="roleFormVisible = false">取消</el-button> |
| @@ -190,8 +190,8 @@ | @@ -190,8 +190,8 @@ | ||
| 190 | data() { | 190 | data() { |
| 191 | return { | 191 | return { |
| 192 | filters: { | 192 | filters: { |
| 193 | - username: '', | ||
| 194 | - realname: '' | 193 | + userName: '', |
| 194 | + realName: '' | ||
| 195 | }, | 195 | }, |
| 196 | users: [], | 196 | users: [], |
| 197 | total: 0, | 197 | total: 0, |
| @@ -269,8 +269,8 @@ | @@ -269,8 +269,8 @@ | ||
| 269 | let para = { | 269 | let para = { |
| 270 | pageNum: this.pageNum, | 270 | pageNum: this.pageNum, |
| 271 | pageSize: this.pageSize, | 271 | pageSize: this.pageSize, |
| 272 | - username: this.filters.username, | ||
| 273 | - realname: this.filters.realname | 272 | + userName: this.filters.userName, |
| 273 | + realName: this.filters.realName | ||
| 274 | }; | 274 | }; |
| 275 | this.listLoading = true; | 275 | this.listLoading = true; |
| 276 | getUserList(para).then((res) => { | 276 | getUserList(para).then((res) => { |
| @@ -346,9 +346,6 @@ | @@ -346,9 +346,6 @@ | ||
| 346 | }else { | 346 | }else { |
| 347 | alert(error); | 347 | alert(error); |
| 348 | } | 348 | } |
| 349 | - | ||
| 350 | - | ||
| 351 | - | ||
| 352 | }); | 349 | }); |
| 353 | 350 | ||
| 354 | }, | 351 | }, |
| @@ -409,9 +406,8 @@ | @@ -409,9 +406,8 @@ | ||
| 409 | if (valid) { | 406 | if (valid) { |
| 410 | this.$confirm('确认提交吗?', '提示', {}).then(() => { | 407 | this.$confirm('确认提交吗?', '提示', {}).then(() => { |
| 411 | this.addLoading = true; | 408 | this.addLoading = true; |
| 412 | - //NProgress.start(); | ||
| 413 | let para = Object.assign({}, this.addForm); | 409 | let para = Object.assign({}, this.addForm); |
| 414 | - para.birth = (!para.birth || para.birth == '') ? '' : util.formatDate.format(new Date(para.birth), 'yyyy-MM-dd'); | 410 | +// para.birth = (!para.birth || para.birth == '') ? '' : util.formatDate.format(new Date(para.birth), 'yyyy-MM-dd'); |
| 415 | addUser(para).then((res) => { | 411 | addUser(para).then((res) => { |
| 416 | this.addLoading = false; | 412 | this.addLoading = false; |
| 417 | //NProgress.done(); | 413 | //NProgress.done(); |
src/views/staff/come_car.vue
0 → 100755
| 1 | +<template> | ||
| 2 | + <section> | ||
| 3 | + <!--工具条--> | ||
| 4 | + <el-col :span="24" class="toolbar" style="padding-bottom: 0px;"> | ||
| 5 | + <el-form :inline="true" :model="filters"> | ||
| 6 | + <el-form-item> | ||
| 7 | + <el-input v-model="filters.cometovisitname" placeholder="报修人名称"></el-input> | ||
| 8 | + </el-form-item> | ||
| 9 | + <el-form-item> | ||
| 10 | + <el-button type="primary" v-on:click="getMaintainList()">查询</el-button> | ||
| 11 | + </el-form-item> | ||
| 12 | + <el-form-item> | ||
| 13 | + <el-button type="primary" @click="companyAdd">新增</el-button> | ||
| 14 | + </el-form-item> | ||
| 15 | + </el-form> | ||
| 16 | + </el-col> | ||
| 17 | + | ||
| 18 | + <!--列表--> | ||
| 19 | + <el-table :data="securityInspectionList" highlight-current-row v-loading="listLoading" @selection-change="selsChange" style="width: 100%;"> | ||
| 20 | + <el-table-column type="selection" width="55"> | ||
| 21 | + </el-table-column> | ||
| 22 | + <el-table-column type="index"> | ||
| 23 | + </el-table-column> | ||
| 24 | + <el-table-column prop="id" v-if="false" label="ID" sortable> | ||
| 25 | + </el-table-column> | ||
| 26 | + <el-table-column prop="datetime" label="日期" sortable> | ||
| 27 | + </el-table-column> | ||
| 28 | + <el-table-column prop="cometovisitdate" label="来访时间" sortable> | ||
| 29 | + </el-table-column> | ||
| 30 | + <el-table-column prop="leavedate" label="离开时间" sortable> | ||
| 31 | + </el-table-column> | ||
| 32 | + <el-table-column prop="cometovisitname" label="姓名" sortable> | ||
| 33 | + </el-table-column> | ||
| 34 | + <el-table-column prop="carnumber" label="车辆牌号" sortable> | ||
| 35 | + </el-table-column> | ||
| 36 | + <el-table-column prop="phone" label="联系电话" sortable> | ||
| 37 | + </el-table-column> | ||
| 38 | + <el-table-column prop="comematter" label="来访事由" sortable> | ||
| 39 | + </el-table-column> | ||
| 40 | + <el-table-column prop="warchkeeper" label="值班人员" sortable> | ||
| 41 | + </el-table-column> | ||
| 42 | + <el-table-column label="操作" min-width="150"> | ||
| 43 | + <template slot-scope="scope"> | ||
| 44 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
| 45 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 46 | + </template> | ||
| 47 | + </el-table-column> | ||
| 48 | + </el-table> | ||
| 49 | + | ||
| 50 | + <!--工具条--> | ||
| 51 | + <el-col :span="24" class="toolbar"> | ||
| 52 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 53 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 54 | + </el-pagination> | ||
| 55 | + </el-col> | ||
| 56 | + | ||
| 57 | + <!--编辑界面--> | ||
| 58 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 59 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 60 | + <el-form-item label="ID"> | ||
| 61 | + <span>{{editForm.id}}</span> | ||
| 62 | + </el-form-item> | ||
| 63 | + <el-form-item label="日期" prop="datetime"> | ||
| 64 | + <el-date-picker | ||
| 65 | + v-model="editForm.datetime" | ||
| 66 | + type="date" | ||
| 67 | + format="yyyy-MM-dd" | ||
| 68 | + value-format="yyyy-MM-dd" | ||
| 69 | + placeholder="选择日期时间"> | ||
| 70 | + </el-date-picker> | ||
| 71 | + </el-form-item> | ||
| 72 | + <el-form-item label="来访时间" prop="cometovisitdate"> | ||
| 73 | + <el-date-picker | ||
| 74 | + v-model="editForm.cometovisitdate" | ||
| 75 | + type="date" | ||
| 76 | + format="yyyy-MM-dd HH:mm:ss" | ||
| 77 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 78 | + placeholder="选择日期时间"> | ||
| 79 | + </el-date-picker> | ||
| 80 | + </el-form-item> | ||
| 81 | + <el-form-item label="离开时间" prop="leavedate"> | ||
| 82 | + <el-date-picker | ||
| 83 | + v-model="editForm.leavedate" | ||
| 84 | + type="date" | ||
| 85 | + format="yyyy-MM-dd HH:mm:ss" | ||
| 86 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 87 | + placeholder="选择日期时间"> | ||
| 88 | + </el-date-picker> | ||
| 89 | + </el-form-item> | ||
| 90 | + <el-form-item label="姓名" prop="cometovisitname"> | ||
| 91 | + <el-input v-model="editForm.cometovisitname" auto-complete="off" placeholder="请输入姓名"></el-input> | ||
| 92 | + </el-form-item> | ||
| 93 | + <el-form-item label="车辆牌号" prop="carnumber"> | ||
| 94 | + <el-input v-model="editForm.carnumber" auto-complete="off" placeholder="请输入车辆牌号"></el-input> | ||
| 95 | + </el-form-item> | ||
| 96 | + <el-form-item label="联系电话" prop="phone"> | ||
| 97 | + <el-input v-model="editForm.phone" auto-complete="off" placeholder="请输入联系电话"></el-input> | ||
| 98 | + </el-form-item> | ||
| 99 | + <el-form-item label="来访事由" prop="comematter"> | ||
| 100 | + <el-input v-model="editForm.comematter" auto-complete="off" placeholder="请输入来访事由"></el-input> | ||
| 101 | + </el-form-item> | ||
| 102 | + <el-form-item label="值班人员" prop="warchkeeper"> | ||
| 103 | + <el-input v-model="editForm.warchkeeper" auto-complete="off" placeholder="请输值班人员"></el-input> | ||
| 104 | + </el-form-item> | ||
| 105 | + </el-form> | ||
| 106 | + <div slot="footer" class="dialog-footer"> | ||
| 107 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 108 | + <el-button type="primary" @click.native="editSubmit" :loading="false">提交</el-button> | ||
| 109 | + </div> | ||
| 110 | + </el-dialog> | ||
| 111 | + | ||
| 112 | + <!--新增界面--> | ||
| 113 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
| 114 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 115 | + <el-form-item label="日期" prop="datetime"> | ||
| 116 | + <el-date-picker | ||
| 117 | + v-model="addForm.datetime" | ||
| 118 | + type="date" | ||
| 119 | + format="yyyy-MM-dd" | ||
| 120 | + value-format="yyyy-MM-dd" | ||
| 121 | + placeholder="选择日期时间"> | ||
| 122 | + </el-date-picker> | ||
| 123 | + </el-form-item> | ||
| 124 | + <el-form-item label="来访时间" prop="cometovisitdate"> | ||
| 125 | + <el-date-picker | ||
| 126 | + v-model="addForm.cometovisitdate" | ||
| 127 | + type="date" | ||
| 128 | + format="yyyy-MM-dd HH:mm:ss" | ||
| 129 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 130 | + placeholder="选择日期时间"> | ||
| 131 | + </el-date-picker> | ||
| 132 | + </el-form-item> | ||
| 133 | + <el-form-item label="离开时间" prop="leavedate"> | ||
| 134 | + <el-date-picker | ||
| 135 | + v-model="addForm.leavedate" | ||
| 136 | + type="date" | ||
| 137 | + format="yyyy-MM-dd HH:mm:ss" | ||
| 138 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 139 | + placeholder="选择日期时间"> | ||
| 140 | + </el-date-picker> | ||
| 141 | + </el-form-item> | ||
| 142 | + <el-form-item label="姓名" prop="cometovisitname"> | ||
| 143 | + <el-input v-model="addForm.cometovisitname" auto-complete="off" placeholder="请输入姓名"></el-input> | ||
| 144 | + </el-form-item> | ||
| 145 | + <el-form-item label="车辆牌号" prop="carnumber"> | ||
| 146 | + <el-input v-model="addForm.carnumber" auto-complete="off" placeholder="请输入车辆牌号"></el-input> | ||
| 147 | + </el-form-item> | ||
| 148 | + <el-form-item label="联系电话" prop="phone"> | ||
| 149 | + <el-input v-model="addForm.phone" auto-complete="off" placeholder="请输入联系电话"></el-input> | ||
| 150 | + </el-form-item> | ||
| 151 | + <el-form-item label="来访事由" prop="comematter"> | ||
| 152 | + <el-input v-model="addForm.comematter" auto-complete="off" placeholder="请输入来访事由"></el-input> | ||
| 153 | + </el-form-item> | ||
| 154 | + <el-form-item label="值班人员" prop="warchkeeper"> | ||
| 155 | + <el-input v-model="addForm.warchkeeper" auto-complete="off" placeholder="请输值班人员"></el-input> | ||
| 156 | + </el-form-item> | ||
| 157 | + </el-form> | ||
| 158 | + <div slot="footer" class="dialog-footer"> | ||
| 159 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 160 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 161 | + </div> | ||
| 162 | + </el-dialog> | ||
| 163 | + </section> | ||
| 164 | +</template> | ||
| 165 | + | ||
| 166 | +<script> | ||
| 167 | + import util from '../../common/js/util' | ||
| 168 | + import NProgress from 'nprogress' | ||
| 169 | + import { getList, remove, batchRemove, edit, add } from '../../api/staff/come_car'; | ||
| 170 | + import moment from 'moment' | ||
| 171 | + | ||
| 172 | + export default { | ||
| 173 | + data() { | ||
| 174 | + return { | ||
| 175 | + filters: { | ||
| 176 | + cometovisitname: '' | ||
| 177 | + }, | ||
| 178 | + userid: '', | ||
| 179 | + securityInspectionList: [], | ||
| 180 | + total: 0, | ||
| 181 | + pageNum: 1, | ||
| 182 | + pageSize: 5, | ||
| 183 | + listLoading: false, | ||
| 184 | + sels: [],//列表选中列 | ||
| 185 | + //编辑界面是否显示 | ||
| 186 | + editFormVisible: false, | ||
| 187 | + editLoading: false, | ||
| 188 | + editFormRules: { | ||
| 189 | + repairscontent: [ | ||
| 190 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 191 | + ], | ||
| 192 | + reflectway: [ | ||
| 193 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 194 | + ], | ||
| 195 | + repairsdept: [ | ||
| 196 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 197 | + ], | ||
| 198 | + repairsname: [ | ||
| 199 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 200 | + ], | ||
| 201 | + answerthephonename: [ | ||
| 202 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 203 | + ], | ||
| 204 | + repairsphone: [ | ||
| 205 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 206 | + ], | ||
| 207 | + maintaincase: [ | ||
| 208 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 209 | + ], | ||
| 210 | + cooperatemaintainname: [ | ||
| 211 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 212 | + ], | ||
| 213 | + meno: [ | ||
| 214 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 215 | + ], | ||
| 216 | + }, | ||
| 217 | + //编辑界面数据 | ||
| 218 | + editForm: { | ||
| 219 | + id:'', | ||
| 220 | + datetime:'', | ||
| 221 | + cometovisitdate:'', | ||
| 222 | + leavedate:'', | ||
| 223 | + cometovisitname: '', | ||
| 224 | + carnumber: '', | ||
| 225 | + phone: '', | ||
| 226 | + comematter: '', | ||
| 227 | + warchkeeper: '' | ||
| 228 | + | ||
| 229 | + }, | ||
| 230 | + //新增界面是否显示 | ||
| 231 | + addFormVisible: false, | ||
| 232 | + addLoading: false, | ||
| 233 | + addFormRules: { | ||
| 234 | + repairscontent: [ | ||
| 235 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 236 | + ], | ||
| 237 | + reflectway: [ | ||
| 238 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 239 | + ], | ||
| 240 | + repairsdept: [ | ||
| 241 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 242 | + ], | ||
| 243 | + repairsname: [ | ||
| 244 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 245 | + ], | ||
| 246 | + answerthephonename: [ | ||
| 247 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 248 | + ], | ||
| 249 | + repairsphone: [ | ||
| 250 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 251 | + ], | ||
| 252 | + maintaincase: [ | ||
| 253 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 254 | + ], | ||
| 255 | + cooperatemaintainname: [ | ||
| 256 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 257 | + ], | ||
| 258 | + meno: [ | ||
| 259 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 260 | + ], | ||
| 261 | + }, | ||
| 262 | + | ||
| 263 | + //新增界面数据 | ||
| 264 | + addForm: { | ||
| 265 | + datetime:'', | ||
| 266 | + cometovisitdate:'', | ||
| 267 | + leavedate:'', | ||
| 268 | + cometovisitname: '', | ||
| 269 | + carnumber: '', | ||
| 270 | + phone: '', | ||
| 271 | + comematter: '', | ||
| 272 | + warchkeeper: '', | ||
| 273 | + userid: this.userid | ||
| 274 | + } | ||
| 275 | + } | ||
| 276 | + }, | ||
| 277 | + mounted() { | ||
| 278 | + this.userid = JSON.parse(sessionStorage.getItem('user')).userId; | ||
| 279 | + this.getMaintainList(); | ||
| 280 | + | ||
| 281 | + }, | ||
| 282 | + methods: { | ||
| 283 | + | ||
| 284 | + handleCurrentChange(val) { | ||
| 285 | + this.pageNum = val; | ||
| 286 | + this.getMaintainList(); | ||
| 287 | + }, | ||
| 288 | + //获取列表 | ||
| 289 | + getMaintainList() { | ||
| 290 | + let para = { | ||
| 291 | + pageNum: this.pageNum, | ||
| 292 | + pageSize: this.pageSize, | ||
| 293 | + cometovisitname: this.filters.cometovisitname | ||
| 294 | + }; | ||
| 295 | + this.listLoading = true; | ||
| 296 | + getList(para).then((res) => { | ||
| 297 | + this.total = res.data.total; | ||
| 298 | + this.securityInspectionList = res.data.list; | ||
| 299 | + this.listLoading = false; | ||
| 300 | + //NProgress.done(); | ||
| 301 | + }).catch((error) => { | ||
| 302 | + | ||
| 303 | + this.listLoading = false; | ||
| 304 | + if(null!= error.response && error.response!==undefined){ | ||
| 305 | + let status= error.response.status; | ||
| 306 | + let msg = error.response.statusText; | ||
| 307 | + alert(status+msg); | ||
| 308 | + }else { | ||
| 309 | + alert(error); | ||
| 310 | + } | ||
| 311 | + | ||
| 312 | + }); | ||
| 313 | + | ||
| 314 | + }, | ||
| 315 | + | ||
| 316 | + | ||
| 317 | + //删除 | ||
| 318 | + handleDel: function (index, row) { | ||
| 319 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 320 | + type: 'warning' | ||
| 321 | + }).then(() => { | ||
| 322 | + this.listLoading = true; | ||
| 323 | + //NProgress.start(); | ||
| 324 | + let para = { id: row.id }; | ||
| 325 | + remove(para).then((res) => { | ||
| 326 | + this.listLoading = false; | ||
| 327 | + //NProgress.done(); | ||
| 328 | + this.$message({ | ||
| 329 | + message: '删除成功', | ||
| 330 | + type: 'success' | ||
| 331 | + }); | ||
| 332 | + this.getMaintainList(); | ||
| 333 | + }).catch((error) => { | ||
| 334 | + this.listLoading = false; | ||
| 335 | + alert(error); | ||
| 336 | + }); | ||
| 337 | + }).catch(); | ||
| 338 | + }, | ||
| 339 | + /** | ||
| 340 | + * 显示编辑界面 | ||
| 341 | + * @param index | ||
| 342 | + * @param row 为这行的数据对象 | ||
| 343 | + */ | ||
| 344 | + handleEdit: function (index, row) { | ||
| 345 | + this.editFormVisible = true; | ||
| 346 | + this.editForm = Object.assign({}, row); | ||
| 347 | + this.getMaintainList(); | ||
| 348 | + }, | ||
| 349 | + //显示新增界面,每次点开初始化数据 | ||
| 350 | + companyAdd: function () { | ||
| 351 | + this.addFormVisible = true; | ||
| 352 | + this.addForm = { | ||
| 353 | + userid: this.userid | ||
| 354 | + }; | ||
| 355 | + this.getMaintainList(); | ||
| 356 | + }, | ||
| 357 | + | ||
| 358 | + //新增 | ||
| 359 | + addSubmit: function () { | ||
| 360 | + this.$refs.addForm.validate((valid) => { | ||
| 361 | + if (valid) { | ||
| 362 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 363 | + //NProgress.start(); | ||
| 364 | + this.listLoading = true; | ||
| 365 | + let para = Object.assign({}, this.addForm); | ||
| 366 | + add(para).then((res) => { | ||
| 367 | + this.addLoading = false; | ||
| 368 | + //NProgress.done(); | ||
| 369 | + this.$message({ | ||
| 370 | + message: '提交成功', | ||
| 371 | + type: 'success' | ||
| 372 | + }); | ||
| 373 | + this.$refs['addForm'].resetFields(); | ||
| 374 | + this.addFormVisible = false; | ||
| 375 | + this.getMaintainList(); | ||
| 376 | + }).catch(error => alert(error)); | ||
| 377 | + }); | ||
| 378 | + } | ||
| 379 | + }); | ||
| 380 | + }, | ||
| 381 | + //编辑 | ||
| 382 | + editSubmit: function () { | ||
| 383 | + this.$refs.editForm.validate((valid) => { | ||
| 384 | + if (valid) { | ||
| 385 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 386 | + this.editLoading = true; | ||
| 387 | + let para = Object.assign({}, this.editForm); | ||
| 388 | + this.editLoading = true; | ||
| 389 | + edit(para).then((res) => { | ||
| 390 | + | ||
| 391 | + this.$message({ | ||
| 392 | + message: '提交成功', | ||
| 393 | + type: 'success' | ||
| 394 | + }); | ||
| 395 | + this.$refs['editForm'].resetFields(); | ||
| 396 | + this.editFormVisible = false; | ||
| 397 | + this.getMaintainList(); | ||
| 398 | + }).catch(error => alert(error)); | ||
| 399 | + }); | ||
| 400 | + } | ||
| 401 | + }); | ||
| 402 | + }, | ||
| 403 | + | ||
| 404 | + selsChange: function (sels) { | ||
| 405 | + this.sels = sels; | ||
| 406 | + }, | ||
| 407 | + //批量删除 | ||
| 408 | + batchRemove: function () { | ||
| 409 | + var ids = this.sels.map(item => item.id).toString(); | ||
| 410 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 411 | + type: 'warning' | ||
| 412 | + }).then(() => { | ||
| 413 | + this.listLoading = true; | ||
| 414 | + //NProgress.start(); | ||
| 415 | + let para = { ids: ids }; | ||
| 416 | + batchRemove(para).then((res) => { | ||
| 417 | + this.listLoading = false; | ||
| 418 | + //NProgress.done(); | ||
| 419 | + this.$message({ | ||
| 420 | + message: '删除成功', | ||
| 421 | + type: 'success' | ||
| 422 | + }); | ||
| 423 | + this.getMaintainList(); | ||
| 424 | + }); | ||
| 425 | + }).catch(() => { | ||
| 426 | + | ||
| 427 | + }); | ||
| 428 | + } | ||
| 429 | + }, | ||
| 430 | + | ||
| 431 | + } | ||
| 432 | +</script> |
-
请 注册 或 登录 后发表评论