更新 elementui 版本 生活保障部门菜单设置 安全巡视 备用钥匙 设备维修 增删改查 特别注意 时间问题
正在显示
27 个修改的文件
包含
1450 行增加
和
45 行删除
| @@ -29,7 +29,7 @@ module.exports = { | @@ -29,7 +29,7 @@ module.exports = { | ||
| 29 | assetsPublicPath: '/', | 29 | assetsPublicPath: '/', |
| 30 | proxyTable: { | 30 | proxyTable: { |
| 31 | '/api':{ | 31 | '/api':{ |
| 32 | - target: 'http://127.0.0.1:8002',//设置你调用的接口域名和端口号 别忘了加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’即可 |
| @@ -3227,13 +3227,15 @@ | @@ -3227,13 +3227,15 @@ | ||
| 3227 | "dev": true | 3227 | "dev": true |
| 3228 | }, | 3228 | }, |
| 3229 | "element-ui": { | 3229 | "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==", | 3230 | + "version": "2.13.0", |
| 3231 | + "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.13.0.tgz", | ||
| 3232 | + "integrity": "sha512-KYsHWsBXYbLELS8cdfvgJTOMSUby3UEjvsPV1V1VmgJ/DdkOAS4z3MiOrPxrT9w2Cc5lZ4eVSQiGhYFR5NVChw==", | ||
| 3233 | "requires": { | 3233 | "requires": { |
| 3234 | "async-validator": "~1.8.1", | 3234 | "async-validator": "~1.8.1", |
| 3235 | "babel-helper-vue-jsx-merge-props": "^2.0.0", | 3235 | "babel-helper-vue-jsx-merge-props": "^2.0.0", |
| 3236 | "deepmerge": "^1.2.0", | 3236 | "deepmerge": "^1.2.0", |
| 3237 | + "normalize-wheel": "^1.0.1", | ||
| 3238 | + "resize-observer-polyfill": "^1.5.0", | ||
| 3237 | "throttle-debounce": "^1.0.1" | 3239 | "throttle-debounce": "^1.0.1" |
| 3238 | } | 3240 | } |
| 3239 | }, | 3241 | }, |
| @@ -6294,6 +6296,11 @@ | @@ -6294,6 +6296,11 @@ | ||
| 6294 | "sort-keys": "^1.0.0" | 6296 | "sort-keys": "^1.0.0" |
| 6295 | } | 6297 | } |
| 6296 | }, | 6298 | }, |
| 6299 | + "normalize-wheel": { | ||
| 6300 | + "version": "1.0.1", | ||
| 6301 | + "resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz", | ||
| 6302 | + "integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU=" | ||
| 6303 | + }, | ||
| 6297 | "npm": { | 6304 | "npm": { |
| 6298 | "version": "6.10.3", | 6305 | "version": "6.10.3", |
| 6299 | "resolved": "https://registry.npmjs.org/npm/-/npm-6.10.3.tgz", | 6306 | "resolved": "https://registry.npmjs.org/npm/-/npm-6.10.3.tgz", |
| @@ -11118,6 +11125,11 @@ | @@ -11118,6 +11125,11 @@ | ||
| 11118 | "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", | 11125 | "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", |
| 11119 | "dev": true | 11126 | "dev": true |
| 11120 | }, | 11127 | }, |
| 11128 | + "resize-observer-polyfill": { | ||
| 11129 | + "version": "1.5.1", | ||
| 11130 | + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", | ||
| 11131 | + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" | ||
| 11132 | + }, | ||
| 11121 | "resolve": { | 11133 | "resolve": { |
| 11122 | "version": "1.12.0", | 11134 | "version": "1.12.0", |
| 11123 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", | 11135 | "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", |
| @@ -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', |
| 1 | import axios from 'axios' | 1 | import axios from 'axios' |
| 2 | 2 | ||
| 3 | -let base = '/company'; | 3 | +let base = '/hqpt-user-center/company'; |
| 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 }); }; |
| 1 | import axios from 'axios' | 1 | import axios from 'axios' |
| 2 | 2 | ||
| 3 | -let base = '/department'; | 3 | +let base = '/hqpt-user-center/department'; |
| 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 }); }; |
| 1 | import axios from 'axios' | 1 | import axios from 'axios' |
| 2 | 2 | ||
| 3 | -let base = '/group'; | 3 | +let base = '/hqpt-user-center/group'; |
| 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 }); }; |
| @@ -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: { |
| 1 | import axios from 'axios' | 1 | import axios from 'axios' |
| 2 | 2 | ||
| 3 | -let base = '/system/log'; | 3 | +let base = '/hqpt-user-center/system/log'; |
| 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 }); }; |
| 1 | import axios from 'axios' | 1 | import axios from 'axios' |
| 2 | 2 | ||
| 3 | -let base = '/perm'; | 3 | +let base = '/hqpt-user-center/perm'; |
| 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 }); }; |
| 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 }); }; |
src/api/staff/key.js
0 → 100644
| 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 → 100644
| 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/security_inspection.js
0 → 100644
| 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 | +})}; |
| 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 |
| 1 | 1 | ||
| 2 | import Vue from 'vue' | 2 | import Vue from 'vue' |
| 3 | import App from './App' | 3 | import App from './App' |
| 4 | -import 'element-ui/lib/theme-default/index.css' | 4 | +import 'element-ui/lib/theme-chalk/index.css' |
| 5 | //import './assets/theme/theme-green/index.css' | 5 | //import './assets/theme/theme-green/index.css' |
| 6 | import VueRouter from 'vue-router' | 6 | import VueRouter from 'vue-router' |
| 7 | import store from './vuex/store' | 7 | import store from './vuex/store' |
| @@ -17,6 +17,9 @@ import Page4 from './views/nav2/Page4.vue' | @@ -17,6 +17,9 @@ import Page4 from './views/nav2/Page4.vue' | ||
| 17 | import Page5 from './views/nav2/Page5.vue' | 17 | import Page5 from './views/nav2/Page5.vue' |
| 18 | import Page6 from './views/nav3/Page6.vue' | 18 | import Page6 from './views/nav3/Page6.vue' |
| 19 | import echarts from './views/charts/echarts.vue' | 19 | import echarts from './views/charts/echarts.vue' |
| 20 | +import SecrityInspection from './views/staff/security_inspection.vue' | ||
| 21 | +import Key from './views/staff/key.vue' | ||
| 22 | +import Maintain from './views/staff/maintain.vue' | ||
| 20 | 23 | ||
| 21 | let routes = [ | 24 | let routes = [ |
| 22 | { | 25 | { |
| @@ -58,23 +61,14 @@ let routes = [ | @@ -58,23 +61,14 @@ let routes = [ | ||
| 58 | ] | 61 | ] |
| 59 | }, | 62 | }, |
| 60 | { | 63 | { |
| 61 | - path: '/agent', | 64 | + path: '/satff', |
| 62 | component: Home, | 65 | component: Home, |
| 63 | - name: '代理人', | 66 | + name: '生活保障部门', |
| 64 | iconCls: 'fa fa-id-card-o', | 67 | iconCls: 'fa fa-id-card-o', |
| 65 | children: [ | 68 | children: [ |
| 66 | - { path: '/pre', component: PreManifest, name: '预配' }, | ||
| 67 | - { path: '/page5', component: Page5, name: '页面5' } | ||
| 68 | - ] | ||
| 69 | - }, | ||
| 70 | - { | ||
| 71 | - path: '/', | ||
| 72 | - component: Home, | ||
| 73 | - name: '导航二', | ||
| 74 | - iconCls: 'fa fa-id-card-o', | ||
| 75 | - children: [ | ||
| 76 | - { path: '/page4', component: Page4, name: '页面4' }, | ||
| 77 | - { path: '/page5', component: Page5, name: '页面5' } | 69 | + { path: '/security_inspection', component: SecrityInspection, name: '职工公寓安全巡视管理' }, |
| 70 | + { path: '/key', component: Key, name: '职工公寓备用钥匙使用登记管理' }, | ||
| 71 | + { path: '/maintain', component: Maintain, name: '职工公寓设施设备维修记录管理' }, | ||
| 78 | ] | 72 | ] |
| 79 | }, | 73 | }, |
| 80 | { | 74 | { |
| @@ -60,7 +60,7 @@ | @@ -60,7 +60,7 @@ | ||
| 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> |
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | </el-col> | 45 | </el-col> |
| 46 | 46 | ||
| 47 | <!--编辑界面--> | 47 | <!--编辑界面--> |
| 48 | - <el-dialog title="编辑" v-model="editFormVisible" :close-on-click-modal="false"> | 48 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> |
| 49 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | 49 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> |
| 50 | <el-form-item label="ID"> | 50 | <el-form-item label="ID"> |
| 51 | <span>{{editForm.companyId}}</span> | 51 | <span>{{editForm.companyId}}</span> |
| @@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
| 71 | </el-dialog> | 71 | </el-dialog> |
| 72 | 72 | ||
| 73 | <!--新增界面--> | 73 | <!--新增界面--> |
| 74 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 74 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 75 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 75 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 76 | <el-form-item label="公司名称" prop="companyName"> | 76 | <el-form-item label="公司名称" prop="companyName"> |
| 77 | <el-input v-model="addForm.companyName" auto-complete="off" placeholder="请输入公司名称"></el-input> | 77 | <el-input v-model="addForm.companyName" auto-complete="off" placeholder="请输入公司名称"></el-input> |
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | </el-col> | 45 | </el-col> |
| 46 | 46 | ||
| 47 | <!--编辑界面--> | 47 | <!--编辑界面--> |
| 48 | - <el-dialog title="编辑" v-model="editFormVisible" :close-on-click-modal="false"> | 48 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> |
| 49 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | 49 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> |
| 50 | <el-form-item label="ID"> | 50 | <el-form-item label="ID"> |
| 51 | <span>{{editForm.departmentId}}</span> | 51 | <span>{{editForm.departmentId}}</span> |
| @@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
| 71 | </el-dialog> | 71 | </el-dialog> |
| 72 | 72 | ||
| 73 | <!--新增界面--> | 73 | <!--新增界面--> |
| 74 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 74 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 75 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 75 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 76 | <el-form-item label="部门名称" prop="deprtmentName"> | 76 | <el-form-item label="部门名称" prop="deprtmentName"> |
| 77 | <el-input v-model="addForm.departmentName" auto-complete="off" placeholder="请输入部门名称"></el-input> | 77 | <el-input v-model="addForm.departmentName" auto-complete="off" placeholder="请输入部门名称"></el-input> |
| @@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
| 43 | </el-col> | 43 | </el-col> |
| 44 | 44 | ||
| 45 | <!--编辑界面--> | 45 | <!--编辑界面--> |
| 46 | - <el-dialog title="编辑" v-model="editFormVisible" :close-on-click-modal="false"> | 46 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> |
| 47 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | 47 | <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> |
| 48 | <el-form-item label="ID"> | 48 | <el-form-item label="ID"> |
| 49 | <span>{{editForm.groupId}}</span> | 49 | <span>{{editForm.groupId}}</span> |
| @@ -59,7 +59,7 @@ | @@ -59,7 +59,7 @@ | ||
| 59 | </el-dialog> | 59 | </el-dialog> |
| 60 | 60 | ||
| 61 | <!--新增界面--> | 61 | <!--新增界面--> |
| 62 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 62 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 63 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 63 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 64 | <el-form-item label="集团名称" prop="groupId"> | 64 | <el-form-item label="集团名称" prop="groupId"> |
| 65 | <el-input v-model="addForm.groupName" auto-complete="off" placeholder="请输入集团名称"></el-input> | 65 | <el-input v-model="addForm.groupName" auto-complete="off" placeholder="请输入集团名称"></el-input> |
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 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.permissionId}}</span> | 53 | <span>{{editForm.permissionId}}</span> |
| @@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
| 89 | </el-dialog> | 89 | </el-dialog> |
| 90 | 90 | ||
| 91 | <!--新增界面--> | 91 | <!--新增界面--> |
| 92 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 92 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 93 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 93 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 94 | <el-form-item label="权限名称" prop="name"> | 94 | <el-form-item label="权限名称" prop="name"> |
| 95 | <el-input v-model="addForm.name" auto-complete="off" placeholder="请输入权限名称:例如:用户新增权限"></el-input> | 95 | <el-input v-model="addForm.name" auto-complete="off" placeholder="请输入权限名称:例如:用户新增权限"></el-input> |
| @@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
| 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> |
| @@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
| 75 | </el-dialog> | 75 | </el-dialog> |
| 76 | 76 | ||
| 77 | <!--新增界面--> | 77 | <!--新增界面--> |
| 78 | - <el-dialog title="新增" v-model="addFormVisible" :close-on-click-modal="false"> | 78 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> |
| 79 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | 79 | <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> |
| 80 | <el-form-item label="岗位/角色名称" prop="roleName"> | 80 | <el-form-item label="岗位/角色名称" prop="roleName"> |
| 81 | <el-input v-model="addForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input> | 81 | <el-input v-model="addForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input> |
| @@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
| 101 | </el-dialog> | 101 | </el-dialog> |
| 102 | 102 | ||
| 103 | <!--权限设置界面--> | 103 | <!--权限设置界面--> |
| 104 | - <el-dialog title="岗位的权限设置" v-model="PermFormVisible" :close-on-click-modal="false"> | 104 | + <el-dialog title="岗位的权限设置" :visible.sync="PermFormVisible" :close-on-click-modal="false"> |
| 105 | <el-form :model="permForm" label-width="80px" ref="permForm"> | 105 | <el-form :model="permForm" label-width="80px" ref="permForm"> |
| 106 | <el-checkbox-group v-model="permIds" size="small"> | 106 | <el-checkbox-group v-model="permIds" size="small"> |
| 107 | <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> |
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 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> |
src/views/staff/key.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.staffname" placeholder="安全巡视员"></el-input> | ||
| 8 | + </el-form-item> | ||
| 9 | + <el-form-item> | ||
| 10 | + <el-button type="primary" v-on:click="getSatffNameList()">查询</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="usedate" label="日期" sortable> | ||
| 27 | + </el-table-column> | ||
| 28 | + <el-table-column prop="roomnum" label="房间号" sortable> | ||
| 29 | + </el-table-column> | ||
| 30 | + <el-table-column prop="usetime" label="时间" sortable> | ||
| 31 | + </el-table-column> | ||
| 32 | + <el-table-column prop="staffname" label="员工姓名" sortable> | ||
| 33 | + </el-table-column> | ||
| 34 | + <el-table-column prop="dept" label="工作部门" sortable> | ||
| 35 | + </el-table-column> | ||
| 36 | + <el-table-column prop="phone" label="联系电话" sortable> | ||
| 37 | + </el-table-column> | ||
| 38 | + <el-table-column prop="ictype" label="证件类型" sortable> | ||
| 39 | + </el-table-column> | ||
| 40 | + <el-table-column prop="iccard" label="证件号码" sortable> | ||
| 41 | + </el-table-column> | ||
| 42 | + <el-table-column prop="roomduty" label="公寓值班" sortable> | ||
| 43 | + </el-table-column> | ||
| 44 | + <el-table-column label="操作" min-width="150"> | ||
| 45 | + <template slot-scope="scope"> | ||
| 46 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
| 47 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 48 | + </template> | ||
| 49 | + </el-table-column> | ||
| 50 | + </el-table> | ||
| 51 | + | ||
| 52 | + <!--工具条--> | ||
| 53 | + <el-col :span="24" class="toolbar"> | ||
| 54 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 55 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 56 | + </el-pagination> | ||
| 57 | + </el-col> | ||
| 58 | + | ||
| 59 | + <!--编辑界面--> | ||
| 60 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 61 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 62 | + <el-form-item label="ID"> | ||
| 63 | + <span>{{editForm.id}}</span> | ||
| 64 | + </el-form-item> | ||
| 65 | + <el-form-item label="日期" prop="usedate"> | ||
| 66 | + <el-date-picker | ||
| 67 | + v-model="editForm.usedate" | ||
| 68 | + type="datetime" | ||
| 69 | + format="yyyy-MM-dd" | ||
| 70 | + value-format="yyyy-MM-dd" | ||
| 71 | + placeholder="选择日期时间"> | ||
| 72 | + </el-date-picker> | ||
| 73 | + </el-form-item> | ||
| 74 | + <el-form-item label="房间号" prop="roomnum"> | ||
| 75 | + <el-input v-model="editForm.roomnum" auto-complete="off" placeholder="房间号"></el-input> | ||
| 76 | + </el-form-item> | ||
| 77 | + <el-form-item label="时间" prop="usetime"> | ||
| 78 | + <el-date-picker | ||
| 79 | + v-model="editForm.usetime" | ||
| 80 | + type="datetime" | ||
| 81 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 82 | + placeholder="选择日期时间"> | ||
| 83 | + </el-date-picker> | ||
| 84 | + </el-form-item> | ||
| 85 | + <el-form-item label="员工姓名" prop="staffname"> | ||
| 86 | + <el-input v-model="editForm.staffname" auto-complete="off" placeholder="员工姓名"></el-input> | ||
| 87 | + </el-form-item> | ||
| 88 | + <el-form-item label="工作部门" prop="dept"> | ||
| 89 | + <el-input v-model="editForm.dept" auto-complete="off" placeholder="工作部门"></el-input> | ||
| 90 | + </el-form-item> | ||
| 91 | + <el-form-item label="联系电话" prop="phone"> | ||
| 92 | + <el-input v-model="editForm.phone" auto-complete="off" placeholder="联系电话"></el-input> | ||
| 93 | + </el-form-item> | ||
| 94 | + <el-form-item label="证件类型" prop="ictype"> | ||
| 95 | + <el-input v-model="editForm.ictype" auto-complete="off" placeholder="证件类型"></el-input> | ||
| 96 | + </el-form-item> | ||
| 97 | + <el-form-item label="证件号码" prop="iccard"> | ||
| 98 | + <el-input v-model="editForm.iccard" auto-complete="off" placeholder="证件号码"></el-input> | ||
| 99 | + </el-form-item> | ||
| 100 | + <el-form-item label="公寓值班" prop="roomduty"> | ||
| 101 | + <el-input v-model="editForm.roomduty" auto-complete="off" placeholder="公寓值班"></el-input> | ||
| 102 | + </el-form-item> | ||
| 103 | + </el-form> | ||
| 104 | + <div slot="footer" class="dialog-footer"> | ||
| 105 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 106 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
| 107 | + </div> | ||
| 108 | + </el-dialog> | ||
| 109 | + | ||
| 110 | + <!--新增界面--> | ||
| 111 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
| 112 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 113 | + <el-form-item label="日期" prop="usedate"> | ||
| 114 | + <el-date-picker | ||
| 115 | + v-model="addForm.usedate" | ||
| 116 | + type="datetime" | ||
| 117 | + format="yyyy-MM-dd" | ||
| 118 | + value-format="yyyy-MM-dd" | ||
| 119 | + placeholder="选择日期时间"> | ||
| 120 | + </el-date-picker> | ||
| 121 | + </el-form-item> | ||
| 122 | + <el-form-item label="房间号" prop="roomnum"> | ||
| 123 | + <el-input v-model="addForm.roomnum" auto-complete="off" placeholder="房间号"></el-input> | ||
| 124 | + </el-form-item> | ||
| 125 | + <el-form-item label="时间" prop="usetime"> | ||
| 126 | + <el-date-picker | ||
| 127 | + v-model="addForm.usetime" | ||
| 128 | + type="datetime" | ||
| 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="staffname"> | ||
| 134 | + <el-input v-model="addForm.staffname" auto-complete="off" placeholder="员工姓名"></el-input> | ||
| 135 | + </el-form-item> | ||
| 136 | + <el-form-item label="工作部门" prop="dept"> | ||
| 137 | + <el-input v-model="addForm.dept" auto-complete="off" placeholder="工作部门"></el-input> | ||
| 138 | + </el-form-item> | ||
| 139 | + <el-form-item label="联系电话" prop="phone"> | ||
| 140 | + <el-input v-model="addForm.phone" auto-complete="off" placeholder="联系电话"></el-input> | ||
| 141 | + </el-form-item> | ||
| 142 | + <el-form-item label="证件类型" prop="ictype"> | ||
| 143 | + <el-input v-model="addForm.ictype" auto-complete="off" placeholder="证件类型"></el-input> | ||
| 144 | + </el-form-item> | ||
| 145 | + <el-form-item label="证件号码" prop="iccard"> | ||
| 146 | + <el-input v-model="addForm.iccard" auto-complete="off" placeholder="证件号码"></el-input> | ||
| 147 | + </el-form-item> | ||
| 148 | + <el-form-item label="公寓值班" prop="roomduty"> | ||
| 149 | + <el-input v-model="addForm.roomduty" auto-complete="off" placeholder="公寓值班"></el-input> | ||
| 150 | + </el-form-item> | ||
| 151 | + </el-form> | ||
| 152 | + <div slot="footer" class="dialog-footer"> | ||
| 153 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 154 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 155 | + </div> | ||
| 156 | + </el-dialog> | ||
| 157 | + </section> | ||
| 158 | +</template> | ||
| 159 | + | ||
| 160 | +<script> | ||
| 161 | + import util from '../../common/js/util' | ||
| 162 | + import NProgress from 'nprogress' | ||
| 163 | + import { getList, remove, batchRemove, edit, add } from '../../api/staff/key'; | ||
| 164 | + import moment from 'moment' | ||
| 165 | + | ||
| 166 | + export default { | ||
| 167 | + data() { | ||
| 168 | + return { | ||
| 169 | + filters: { | ||
| 170 | + staffname: '' | ||
| 171 | + }, | ||
| 172 | + createby: '', | ||
| 173 | + securityInspectionList: [], | ||
| 174 | + total: 0, | ||
| 175 | + pageNum: 1, | ||
| 176 | + pageSize: 5, | ||
| 177 | + listLoading: false, | ||
| 178 | + sels: [],//列表选中列 | ||
| 179 | + //编辑界面是否显示 | ||
| 180 | + editFormVisible: false, | ||
| 181 | + editLoading: false, | ||
| 182 | + editFormRules: { | ||
| 183 | + | ||
| 184 | + roomnum: [ | ||
| 185 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 186 | + ], | ||
| 187 | + | ||
| 188 | + staffname: [ | ||
| 189 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 190 | + ], | ||
| 191 | + dept: [ | ||
| 192 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 193 | + ], | ||
| 194 | + phone: [ | ||
| 195 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 196 | + ], | ||
| 197 | + ictype: [ | ||
| 198 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 199 | + ], | ||
| 200 | + iccard: [ | ||
| 201 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 202 | + ], | ||
| 203 | + roomduty: [ | ||
| 204 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 205 | + ], | ||
| 206 | + }, | ||
| 207 | + //编辑界面数据 | ||
| 208 | + editForm: { | ||
| 209 | + usedate: '', | ||
| 210 | + roomnum: '', | ||
| 211 | + usetime: '', | ||
| 212 | + staffname: '', | ||
| 213 | + dept: '', | ||
| 214 | + phone: '', | ||
| 215 | + ictype: '', | ||
| 216 | + iccard: '', | ||
| 217 | + roomduty: '' | ||
| 218 | + }, | ||
| 219 | + //新增界面是否显示 | ||
| 220 | + addFormVisible: false, | ||
| 221 | + addLoading: false, | ||
| 222 | + addFormRules: { | ||
| 223 | + | ||
| 224 | + roomnum: [ | ||
| 225 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 226 | + ], | ||
| 227 | + | ||
| 228 | + staffname: [ | ||
| 229 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 230 | + ], | ||
| 231 | + dept: [ | ||
| 232 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 233 | + ], | ||
| 234 | + phone: [ | ||
| 235 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 236 | + ], | ||
| 237 | + ictype: [ | ||
| 238 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 239 | + ], | ||
| 240 | + iccard: [ | ||
| 241 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 242 | + ], | ||
| 243 | + roomduty: [ | ||
| 244 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 245 | + ], | ||
| 246 | + }, | ||
| 247 | + | ||
| 248 | + //新增界面数据 | ||
| 249 | + addForm: { | ||
| 250 | + securityInspectionName: '', | ||
| 251 | +// securityInspectionDate: '', | ||
| 252 | + fireName: '', | ||
| 253 | + securityElectro: '', | ||
| 254 | + fireproofing: '', | ||
| 255 | + doubtfulPerson: '', | ||
| 256 | + violationsCar: '', | ||
| 257 | + builders: '', | ||
| 258 | + otherSituations: '', | ||
| 259 | + optTime:'', | ||
| 260 | + realname:'', | ||
| 261 | + createby: this.createby | ||
| 262 | + } | ||
| 263 | + } | ||
| 264 | + }, | ||
| 265 | + mounted() { | ||
| 266 | + this.createby = JSON.parse(sessionStorage.getItem('user')).userId; | ||
| 267 | + this.getSatffNameList(); | ||
| 268 | + | ||
| 269 | + }, | ||
| 270 | + methods: { | ||
| 271 | + | ||
| 272 | + handleCurrentChange(val) { | ||
| 273 | + this.pageNum = val; | ||
| 274 | + this.getSatffNameList(); | ||
| 275 | + }, | ||
| 276 | + //获取公司列表 | ||
| 277 | + getSatffNameList() { | ||
| 278 | + let para = { | ||
| 279 | + pageNum: this.pageNum, | ||
| 280 | + pageSize: this.pageSize, | ||
| 281 | + staffname: this.filters.staffname | ||
| 282 | + }; | ||
| 283 | + this.listLoading = true; | ||
| 284 | + getList(para).then((res) => { | ||
| 285 | + this.total = res.data.total; | ||
| 286 | + this.securityInspectionList = res.data.list; | ||
| 287 | + this.listLoading = false; | ||
| 288 | + //NProgress.done(); | ||
| 289 | + }).catch((error) => { | ||
| 290 | + | ||
| 291 | + this.listLoading = false; | ||
| 292 | + if(null!= error.response && error.response!==undefined){ | ||
| 293 | + let status= error.response.status; | ||
| 294 | + let msg = error.response.statusText; | ||
| 295 | + alert(status+msg); | ||
| 296 | + }else { | ||
| 297 | + alert(error); | ||
| 298 | + } | ||
| 299 | + | ||
| 300 | + }); | ||
| 301 | + | ||
| 302 | + }, | ||
| 303 | + | ||
| 304 | + | ||
| 305 | + //删除 | ||
| 306 | + handleDel: function (index, row) { | ||
| 307 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 308 | + type: 'warning' | ||
| 309 | + }).then(() => { | ||
| 310 | + this.listLoading = true; | ||
| 311 | + //NProgress.start(); | ||
| 312 | + let para = { id: row.id }; | ||
| 313 | + remove(para).then((res) => { | ||
| 314 | + this.listLoading = false; | ||
| 315 | + //NProgress.done(); | ||
| 316 | + this.$message({ | ||
| 317 | + message: '删除成功', | ||
| 318 | + type: 'success' | ||
| 319 | + }); | ||
| 320 | + this.getSatffNameList(); | ||
| 321 | + }).catch((error) => { | ||
| 322 | + this.listLoading = false; | ||
| 323 | + alert(error); | ||
| 324 | + }); | ||
| 325 | + }).catch(); | ||
| 326 | + }, | ||
| 327 | + /** | ||
| 328 | + * 显示编辑界面 | ||
| 329 | + * @param index | ||
| 330 | + * @param row 为这行的数据对象 | ||
| 331 | + */ | ||
| 332 | + handleEdit: function (index, row) { | ||
| 333 | + this.editFormVisible = true; | ||
| 334 | + this.editForm = Object.assign({}, row); | ||
| 335 | + this.getSatffNameList(); | ||
| 336 | + }, | ||
| 337 | + //显示新增界面,每次点开初始化数据 | ||
| 338 | + companyAdd: function () { | ||
| 339 | + this.addFormVisible = true; | ||
| 340 | + this.addForm = { | ||
| 341 | + createby: this.createby | ||
| 342 | + }; | ||
| 343 | + this.getSatffNameList(); | ||
| 344 | + }, | ||
| 345 | + | ||
| 346 | + //新增 | ||
| 347 | + addSubmit: function () { | ||
| 348 | + this.$refs.addForm.validate((valid) => { | ||
| 349 | + if (valid) { | ||
| 350 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 351 | + //NProgress.start(); | ||
| 352 | + this.listLoading = true; | ||
| 353 | + let para = Object.assign({}, this.addForm); | ||
| 354 | + add(para).then((res) => { | ||
| 355 | + this.addLoading = false; | ||
| 356 | + //NProgress.done(); | ||
| 357 | + this.$message({ | ||
| 358 | + message: '提交成功', | ||
| 359 | + type: 'success' | ||
| 360 | + }); | ||
| 361 | + this.$refs['addForm'].resetFields(); | ||
| 362 | + this.addFormVisible = false; | ||
| 363 | + this.getSatffNameList(); | ||
| 364 | + }).catch(error => alert(error)); | ||
| 365 | + }); | ||
| 366 | + } | ||
| 367 | + }); | ||
| 368 | + }, | ||
| 369 | + //编辑 | ||
| 370 | + editSubmit: function () { | ||
| 371 | + this.$refs.editForm.validate((valid) => { | ||
| 372 | + if (valid) { | ||
| 373 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 374 | + this.editLoading = true; | ||
| 375 | + let para = Object.assign({}, this.editForm); | ||
| 376 | + this.editLoading = true; | ||
| 377 | + edit(para).then((res) => { | ||
| 378 | + | ||
| 379 | + this.$message({ | ||
| 380 | + message: '提交成功', | ||
| 381 | + type: 'success' | ||
| 382 | + }); | ||
| 383 | + this.$refs['editForm'].resetFields(); | ||
| 384 | + this.editFormVisible = false; | ||
| 385 | + this.getSatffNameList(); | ||
| 386 | + }).catch(error => alert(error)); | ||
| 387 | + }); | ||
| 388 | + } | ||
| 389 | + }); | ||
| 390 | + }, | ||
| 391 | + | ||
| 392 | + selsChange: function (sels) { | ||
| 393 | + this.sels = sels; | ||
| 394 | + }, | ||
| 395 | + //批量删除 | ||
| 396 | + batchRemove: function () { | ||
| 397 | + var ids = this.sels.map(item => item.id).toString(); | ||
| 398 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 399 | + type: 'warning' | ||
| 400 | + }).then(() => { | ||
| 401 | + this.listLoading = true; | ||
| 402 | + //NProgress.start(); | ||
| 403 | + let para = { ids: ids }; | ||
| 404 | + batchRemove(para).then((res) => { | ||
| 405 | + this.listLoading = false; | ||
| 406 | + //NProgress.done(); | ||
| 407 | + this.$message({ | ||
| 408 | + message: '删除成功', | ||
| 409 | + type: 'success' | ||
| 410 | + }); | ||
| 411 | + this.getSatffNameList(); | ||
| 412 | + }); | ||
| 413 | + }).catch(() => { | ||
| 414 | + | ||
| 415 | + }); | ||
| 416 | + } | ||
| 417 | + }, | ||
| 418 | + | ||
| 419 | + } | ||
| 420 | +</script> |
src/views/staff/maintain.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.repairsname" 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="repairsdate" label="日期" sortable> | ||
| 27 | + </el-table-column> | ||
| 28 | + <el-table-column prop="repairscontent" label="报修内容" sortable> | ||
| 29 | + </el-table-column> | ||
| 30 | + <el-table-column prop="reflectway" label="反映途径" sortable> | ||
| 31 | + </el-table-column> | ||
| 32 | + <el-table-column prop="repairsdept" label="维修部门" sortable> | ||
| 33 | + </el-table-column> | ||
| 34 | + <el-table-column prop="answerthephonename" label="接电话人员" sortable> | ||
| 35 | + </el-table-column> | ||
| 36 | + <el-table-column prop="repairsname" label="报修人" sortable> | ||
| 37 | + </el-table-column> | ||
| 38 | + <el-table-column prop="repairsphone" label="报修电话" sortable> | ||
| 39 | + </el-table-column> | ||
| 40 | + <el-table-column prop="maintaindate" label="维修日期" sortable> | ||
| 41 | + </el-table-column> | ||
| 42 | + <el-table-column prop="maintaincase" label="维修情况" sortable> | ||
| 43 | + </el-table-column> | ||
| 44 | + <el-table-column prop="cooperatemaintainname" label="配合维修人员" sortable> | ||
| 45 | + </el-table-column> | ||
| 46 | + <el-table-column prop="meno" label="备注" sortable> | ||
| 47 | + </el-table-column> | ||
| 48 | + <el-table-column label="操作" min-width="150"> | ||
| 49 | + <template slot-scope="scope"> | ||
| 50 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
| 51 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 52 | + </template> | ||
| 53 | + </el-table-column> | ||
| 54 | + </el-table> | ||
| 55 | + | ||
| 56 | + <!--工具条--> | ||
| 57 | + <el-col :span="24" class="toolbar"> | ||
| 58 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 59 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 60 | + </el-pagination> | ||
| 61 | + </el-col> | ||
| 62 | + | ||
| 63 | + <!--编辑界面--> | ||
| 64 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 65 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 66 | + <el-form-item label="ID"> | ||
| 67 | + <span>{{editForm.id}}</span> | ||
| 68 | + </el-form-item> | ||
| 69 | + <el-form-item label="日期" prop="repairsdate"> | ||
| 70 | + <el-date-picker | ||
| 71 | + v-model="editForm.repairsdate" | ||
| 72 | + type="date" | ||
| 73 | + format="yyyy-MM-dd" | ||
| 74 | + value-format="yyyy-MM-dd" | ||
| 75 | + placeholder="选择日期时间"> | ||
| 76 | + </el-date-picker> | ||
| 77 | + </el-form-item> | ||
| 78 | + <el-form-item label="报修内容" prop="repairscontent"> | ||
| 79 | + <el-input v-model="editForm.repairscontent" auto-complete="off" placeholder="请输入报修内容"></el-input> | ||
| 80 | + </el-form-item> | ||
| 81 | + <el-form-item label="反映途径" prop="reflectway"> | ||
| 82 | + <el-input v-model="editForm.reflectway" auto-complete="off" placeholder="请输入反映途径"></el-input> | ||
| 83 | + </el-form-item> | ||
| 84 | + <el-form-item label="维修部门" prop="repairsdept"> | ||
| 85 | + <el-input v-model="editForm.repairsdept" auto-complete="off" placeholder="请输入维修部门"></el-input> | ||
| 86 | + </el-form-item> | ||
| 87 | + <el-form-item label="接电话人员" prop="answerthephonename"> | ||
| 88 | + <el-input v-model="editForm.answerthephonename" auto-complete="off" placeholder="请输入接电话人员"></el-input> | ||
| 89 | + </el-form-item> | ||
| 90 | + <el-form-item label="报修人" prop="repairsname"> | ||
| 91 | + <el-input v-model="editForm.repairsname" auto-complete="off" placeholder="请输入报修人"></el-input> | ||
| 92 | + </el-form-item> | ||
| 93 | + <el-form-item label="报修电话" prop="repairsphone"> | ||
| 94 | + <el-input v-model="editForm.repairsphone" auto-complete="off" placeholder="请输报修电话"></el-input> | ||
| 95 | + </el-form-item> | ||
| 96 | + <el-form-item label="维修时间" prop="maintaindate"> | ||
| 97 | + <el-date-picker | ||
| 98 | + v-model="editForm.maintaindate" | ||
| 99 | + type="datetime" | ||
| 100 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 101 | + placeholder="选择日期时间"> | ||
| 102 | + </el-date-picker> | ||
| 103 | + </el-form-item> | ||
| 104 | + <el-form-item label="维修情况" prop="maintaincase"> | ||
| 105 | + <el-input v-model="editForm.maintaincase" auto-complete="off" placeholder="请输入维修情况"></el-input> | ||
| 106 | + </el-form-item> | ||
| 107 | + <el-form-item label="配合维修人员" prop="cooperatemaintainname"> | ||
| 108 | + <el-input v-model="editForm.cooperatemaintainname" auto-complete="off" placeholder="请输入配合维修人员"></el-input> | ||
| 109 | + </el-form-item> | ||
| 110 | + <el-form-item label="备注" prop="meno"> | ||
| 111 | + <el-input v-model="editForm.meno" auto-complete="off" placeholder="请输入备注"></el-input> | ||
| 112 | + </el-form-item> | ||
| 113 | + </el-form> | ||
| 114 | + <div slot="footer" class="dialog-footer"> | ||
| 115 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 116 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
| 117 | + </div> | ||
| 118 | + </el-dialog> | ||
| 119 | + | ||
| 120 | + <!--新增界面--> | ||
| 121 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
| 122 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 123 | + <el-form-item label="日期" prop="repairsdate"> | ||
| 124 | + <el-date-picker | ||
| 125 | + v-model="addForm.repairsdate" | ||
| 126 | + type="datetime" | ||
| 127 | + format="yyyy-MM-dd" | ||
| 128 | + value-format="yyyy-MM-dd" | ||
| 129 | + placeholder="选择日期时间"> | ||
| 130 | + </el-date-picker> | ||
| 131 | + </el-form-item> | ||
| 132 | + <el-form-item label="报修内容" prop="repairscontent"> | ||
| 133 | + <el-input v-model="addForm.repairscontent" auto-complete="off" placeholder="请输入报修内容"></el-input> | ||
| 134 | + </el-form-item> | ||
| 135 | + <el-form-item label="反映途径" prop="reflectway"> | ||
| 136 | + <el-input v-model="addForm.reflectway" auto-complete="off" placeholder="请输入反映途径"></el-input> | ||
| 137 | + </el-form-item> | ||
| 138 | + <el-form-item label="维修部门" prop="repairsdept"> | ||
| 139 | + <el-input v-model="addForm.repairsdept" auto-complete="off" placeholder="请输入维修部门"></el-input> | ||
| 140 | + </el-form-item> | ||
| 141 | + <el-form-item label="接电话人员" prop="answerthephonename"> | ||
| 142 | + <el-input v-model="addForm.answerthephonename" auto-complete="off" placeholder="请输入接电话人员"></el-input> | ||
| 143 | + </el-form-item> | ||
| 144 | + <el-form-item label="报修人" prop="repairsname"> | ||
| 145 | + <el-input v-model="addForm.repairsname" auto-complete="off" placeholder="请输入报修人"></el-input> | ||
| 146 | + </el-form-item> | ||
| 147 | + <el-form-item label="报修电话" prop="repairsphone"> | ||
| 148 | + <el-input v-model="addForm.repairsphone" auto-complete="off" placeholder="请输报修电话"></el-input> | ||
| 149 | + </el-form-item> | ||
| 150 | + <el-form-item label="维修日期" prop="maintaindate"> | ||
| 151 | + <el-date-picker | ||
| 152 | + v-model="addForm.maintaindate" | ||
| 153 | + type="datetime" | ||
| 154 | + format="yyyy-MM-dd" | ||
| 155 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 156 | + placeholder="选择日期时间"> | ||
| 157 | + </el-date-picker> | ||
| 158 | + </el-form-item> | ||
| 159 | + <el-form-item label="维修情况" prop="maintaincase"> | ||
| 160 | + <el-input v-model="addForm.maintaincase" auto-complete="off" placeholder="请输入维修情况"></el-input> | ||
| 161 | + </el-form-item> | ||
| 162 | + <el-form-item label="配合维修人员" prop="cooperatemaintainname"> | ||
| 163 | + <el-input v-model="addForm.cooperatemaintainname" auto-complete="off" placeholder="请输入配合维修人员"></el-input> | ||
| 164 | + </el-form-item> | ||
| 165 | + <el-form-item label="备注" prop="meno"> | ||
| 166 | + <el-input v-model="addForm.meno" auto-complete="off" placeholder="请输入备注"></el-input> | ||
| 167 | + </el-form-item> | ||
| 168 | + </el-form> | ||
| 169 | + <div slot="footer" class="dialog-footer"> | ||
| 170 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 171 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 172 | + </div> | ||
| 173 | + </el-dialog> | ||
| 174 | + </section> | ||
| 175 | +</template> | ||
| 176 | + | ||
| 177 | +<script> | ||
| 178 | + import util from '../../common/js/util' | ||
| 179 | + import NProgress from 'nprogress' | ||
| 180 | + import { getList, remove, batchRemove, edit, add } from '../../api/staff/maintain'; | ||
| 181 | + import moment from 'moment' | ||
| 182 | + | ||
| 183 | + export default { | ||
| 184 | + data() { | ||
| 185 | + return { | ||
| 186 | + filters: { | ||
| 187 | + repairsname: '' | ||
| 188 | + }, | ||
| 189 | + createby: '', | ||
| 190 | + securityInspectionList: [], | ||
| 191 | + total: 0, | ||
| 192 | + pageNum: 1, | ||
| 193 | + pageSize: 5, | ||
| 194 | + listLoading: false, | ||
| 195 | + sels: [],//列表选中列 | ||
| 196 | + //编辑界面是否显示 | ||
| 197 | + editFormVisible: false, | ||
| 198 | + editLoading: false, | ||
| 199 | + editFormRules: { | ||
| 200 | + repairscontent: [ | ||
| 201 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 202 | + ], | ||
| 203 | + reflectway: [ | ||
| 204 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 205 | + ], | ||
| 206 | + repairsdept: [ | ||
| 207 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 208 | + ], | ||
| 209 | + repairsname: [ | ||
| 210 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 211 | + ], | ||
| 212 | + answerthephonename: [ | ||
| 213 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 214 | + ], | ||
| 215 | + repairsphone: [ | ||
| 216 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 217 | + ], | ||
| 218 | + maintaincase: [ | ||
| 219 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 220 | + ], | ||
| 221 | + cooperatemaintainname: [ | ||
| 222 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 223 | + ], | ||
| 224 | + meno: [ | ||
| 225 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 226 | + ], | ||
| 227 | + }, | ||
| 228 | + //编辑界面数据 | ||
| 229 | + editForm: { | ||
| 230 | + repairsdate: '', | ||
| 231 | + repairscontent: '', | ||
| 232 | + reflectway: '', | ||
| 233 | + repairsdept: '', | ||
| 234 | + repairsname: '', | ||
| 235 | + answerthephonename: '', | ||
| 236 | + repairsphone: '', | ||
| 237 | + maintaindate: '', | ||
| 238 | + maintaincase: '', | ||
| 239 | + cooperatemaintainname: '', | ||
| 240 | + meno:"" | ||
| 241 | + | ||
| 242 | + }, | ||
| 243 | + //新增界面是否显示 | ||
| 244 | + addFormVisible: false, | ||
| 245 | + addLoading: false, | ||
| 246 | + addFormRules: { | ||
| 247 | + repairscontent: [ | ||
| 248 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 249 | + ], | ||
| 250 | + reflectway: [ | ||
| 251 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 252 | + ], | ||
| 253 | + repairsdept: [ | ||
| 254 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 255 | + ], | ||
| 256 | + repairsname: [ | ||
| 257 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 258 | + ], | ||
| 259 | + answerthephonename: [ | ||
| 260 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 261 | + ], | ||
| 262 | + repairsphone: [ | ||
| 263 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 264 | + ], | ||
| 265 | + maintaincase: [ | ||
| 266 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 267 | + ], | ||
| 268 | + cooperatemaintainname: [ | ||
| 269 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 270 | + ], | ||
| 271 | + meno: [ | ||
| 272 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 273 | + ], | ||
| 274 | + }, | ||
| 275 | + | ||
| 276 | + //新增界面数据 | ||
| 277 | + addForm: { | ||
| 278 | + repairsdate: '', | ||
| 279 | + repairscontent: '', | ||
| 280 | + reflectway: '', | ||
| 281 | + repairsdept: '', | ||
| 282 | + repairsname: '', | ||
| 283 | + answerthephonename: '', | ||
| 284 | + repairsphone: '', | ||
| 285 | + maintaindate: '', | ||
| 286 | + maintaincase: '', | ||
| 287 | + cooperatemaintainname: '', | ||
| 288 | + meno:"", | ||
| 289 | + createby: this.createby | ||
| 290 | + } | ||
| 291 | + } | ||
| 292 | + }, | ||
| 293 | + mounted() { | ||
| 294 | + this.createby = JSON.parse(sessionStorage.getItem('user')).userId; | ||
| 295 | + this.getMaintainList(); | ||
| 296 | + | ||
| 297 | + }, | ||
| 298 | + methods: { | ||
| 299 | + | ||
| 300 | + handleCurrentChange(val) { | ||
| 301 | + this.pageNum = val; | ||
| 302 | + this.getMaintainList(); | ||
| 303 | + }, | ||
| 304 | + //获取公司列表 | ||
| 305 | + getMaintainList() { | ||
| 306 | + let para = { | ||
| 307 | + pageNum: this.pageNum, | ||
| 308 | + pageSize: this.pageSize, | ||
| 309 | + repairsname: this.filters.repairsname | ||
| 310 | + }; | ||
| 311 | + this.listLoading = true; | ||
| 312 | + getList(para).then((res) => { | ||
| 313 | + this.total = res.data.total; | ||
| 314 | + this.securityInspectionList = res.data.list; | ||
| 315 | + this.listLoading = false; | ||
| 316 | + //NProgress.done(); | ||
| 317 | + }).catch((error) => { | ||
| 318 | + | ||
| 319 | + this.listLoading = false; | ||
| 320 | + if(null!= error.response && error.response!==undefined){ | ||
| 321 | + let status= error.response.status; | ||
| 322 | + let msg = error.response.statusText; | ||
| 323 | + alert(status+msg); | ||
| 324 | + }else { | ||
| 325 | + alert(error); | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + }); | ||
| 329 | + | ||
| 330 | + }, | ||
| 331 | + | ||
| 332 | + | ||
| 333 | + //删除 | ||
| 334 | + handleDel: function (index, row) { | ||
| 335 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 336 | + type: 'warning' | ||
| 337 | + }).then(() => { | ||
| 338 | + this.listLoading = true; | ||
| 339 | + //NProgress.start(); | ||
| 340 | + let para = { id: row.id }; | ||
| 341 | + remove(para).then((res) => { | ||
| 342 | + this.listLoading = false; | ||
| 343 | + //NProgress.done(); | ||
| 344 | + this.$message({ | ||
| 345 | + message: '删除成功', | ||
| 346 | + type: 'success' | ||
| 347 | + }); | ||
| 348 | + this.getMaintainList(); | ||
| 349 | + }).catch((error) => { | ||
| 350 | + this.listLoading = false; | ||
| 351 | + alert(error); | ||
| 352 | + }); | ||
| 353 | + }).catch(); | ||
| 354 | + }, | ||
| 355 | + /** | ||
| 356 | + * 显示编辑界面 | ||
| 357 | + * @param index | ||
| 358 | + * @param row 为这行的数据对象 | ||
| 359 | + */ | ||
| 360 | + handleEdit: function (index, row) { | ||
| 361 | + this.editFormVisible = true; | ||
| 362 | + this.editForm = Object.assign({}, row); | ||
| 363 | + this.getMaintainList(); | ||
| 364 | + }, | ||
| 365 | + //显示新增界面,每次点开初始化数据 | ||
| 366 | + companyAdd: function () { | ||
| 367 | + this.addFormVisible = true; | ||
| 368 | + this.addForm = { | ||
| 369 | + createby: this.createby | ||
| 370 | + }; | ||
| 371 | + this.getMaintainList(); | ||
| 372 | + }, | ||
| 373 | + | ||
| 374 | + //新增 | ||
| 375 | + addSubmit: function () { | ||
| 376 | + this.$refs.addForm.validate((valid) => { | ||
| 377 | + if (valid) { | ||
| 378 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 379 | + //NProgress.start(); | ||
| 380 | + this.listLoading = true; | ||
| 381 | + let para = Object.assign({}, this.addForm); | ||
| 382 | + add(para).then((res) => { | ||
| 383 | + this.addLoading = false; | ||
| 384 | + //NProgress.done(); | ||
| 385 | + this.$message({ | ||
| 386 | + message: '提交成功', | ||
| 387 | + type: 'success' | ||
| 388 | + }); | ||
| 389 | + this.$refs['addForm'].resetFields(); | ||
| 390 | + this.addFormVisible = false; | ||
| 391 | + this.getMaintainList(); | ||
| 392 | + }).catch(error => alert(error)); | ||
| 393 | + }); | ||
| 394 | + } | ||
| 395 | + }); | ||
| 396 | + }, | ||
| 397 | + //编辑 | ||
| 398 | + editSubmit: function () { | ||
| 399 | + this.$refs.editForm.validate((valid) => { | ||
| 400 | + if (valid) { | ||
| 401 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 402 | + this.editLoading = true; | ||
| 403 | + let para = Object.assign({}, this.editForm); | ||
| 404 | + this.editLoading = true; | ||
| 405 | + edit(para).then((res) => { | ||
| 406 | + | ||
| 407 | + this.$message({ | ||
| 408 | + message: '提交成功', | ||
| 409 | + type: 'success' | ||
| 410 | + }); | ||
| 411 | + this.$refs['editForm'].resetFields(); | ||
| 412 | + this.editFormVisible = false; | ||
| 413 | + this.getMaintainList(); | ||
| 414 | + }).catch(error => alert(error)); | ||
| 415 | + }); | ||
| 416 | + } | ||
| 417 | + }); | ||
| 418 | + }, | ||
| 419 | + | ||
| 420 | + selsChange: function (sels) { | ||
| 421 | + this.sels = sels; | ||
| 422 | + }, | ||
| 423 | + //批量删除 | ||
| 424 | + batchRemove: function () { | ||
| 425 | + var ids = this.sels.map(item => item.id).toString(); | ||
| 426 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 427 | + type: 'warning' | ||
| 428 | + }).then(() => { | ||
| 429 | + this.listLoading = true; | ||
| 430 | + //NProgress.start(); | ||
| 431 | + let para = { ids: ids }; | ||
| 432 | + batchRemove(para).then((res) => { | ||
| 433 | + this.listLoading = false; | ||
| 434 | + //NProgress.done(); | ||
| 435 | + this.$message({ | ||
| 436 | + message: '删除成功', | ||
| 437 | + type: 'success' | ||
| 438 | + }); | ||
| 439 | + this.getMaintainList(); | ||
| 440 | + }); | ||
| 441 | + }).catch(() => { | ||
| 442 | + | ||
| 443 | + }); | ||
| 444 | + } | ||
| 445 | + }, | ||
| 446 | + | ||
| 447 | + } | ||
| 448 | +</script> |
src/views/staff/security_inspection.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.securityInspectionName" placeholder="安全巡视员"></el-input> | ||
| 8 | + </el-form-item> | ||
| 9 | + <el-form-item> | ||
| 10 | + <el-button type="primary" v-on:click="getSecurityInspectionList()">查询</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="securityInspectionId" v-if="false" label="ID" sortable> | ||
| 25 | + </el-table-column> | ||
| 26 | + <el-table-column prop="securityInspectionName" label="安检巡视员" sortable> | ||
| 27 | + </el-table-column> | ||
| 28 | + <el-table-column prop="fireName" label="消防通道及隔离设备" sortable> | ||
| 29 | + </el-table-column> | ||
| 30 | + <el-table-column prop="securityElectro" label="安全用电" sortable> | ||
| 31 | + </el-table-column> | ||
| 32 | + <el-table-column prop="fireproofing" label="防火防盗" sortable> | ||
| 33 | + </el-table-column> | ||
| 34 | + <el-table-column prop="doubtfulPerson" label="可疑人员" sortable> | ||
| 35 | + </el-table-column> | ||
| 36 | + <el-table-column prop="violationsCar" label="违规停放车辆" sortable> | ||
| 37 | + </el-table-column> | ||
| 38 | + <el-table-column prop="builders" label="施工人员" sortable> | ||
| 39 | + </el-table-column> | ||
| 40 | + <el-table-column prop="builders" label="其他情况" sortable> | ||
| 41 | + </el-table-column> | ||
| 42 | + <el-table-column prop="optTime" label="操作时间" sortable> | ||
| 43 | + </el-table-column> | ||
| 44 | + <el-table-column label="操作" min-width="150"> | ||
| 45 | + <template slot-scope="scope"> | ||
| 46 | + <el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> | ||
| 47 | + <el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button> | ||
| 48 | + </template> | ||
| 49 | + </el-table-column> | ||
| 50 | + </el-table> | ||
| 51 | + | ||
| 52 | + <!--工具条--> | ||
| 53 | + <el-col :span="24" class="toolbar"> | ||
| 54 | + <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> | ||
| 55 | + <el-pagination layout="total, prev, pager, next" @current-change="handleCurrentChange" :page-size="5" :total="total" style="float:right;"> | ||
| 56 | + </el-pagination> | ||
| 57 | + </el-col> | ||
| 58 | + | ||
| 59 | + <!--编辑界面--> | ||
| 60 | + <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> | ||
| 61 | + <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> | ||
| 62 | + <el-form-item label="ID"> | ||
| 63 | + <span>{{editForm.securityInspectionId}}</span> | ||
| 64 | + </el-form-item> | ||
| 65 | + <el-form-item label="安检巡视员" prop="securityInspectionName"> | ||
| 66 | + <el-input v-model="editForm.securityInspectionName" auto-complete="off" placeholder="请输入安检巡视员"></el-input> | ||
| 67 | + </el-form-item> | ||
| 68 | + <el-form-item label="消防通道及隔离设备" prop="fireName"> | ||
| 69 | + <el-input v-model="editForm.fireName" auto-complete="off" placeholder="请输入消防通道及隔离设备"></el-input> | ||
| 70 | + </el-form-item> | ||
| 71 | + <el-form-item label="安全用电" prop="securityElectro"> | ||
| 72 | + <el-input v-model="editForm.securityElectro" auto-complete="off" placeholder="请输入安全用电"></el-input> | ||
| 73 | + </el-form-item> | ||
| 74 | + <el-form-item label="防火防盗" prop="fireproofing"> | ||
| 75 | + <el-input v-model="editForm.fireproofing" auto-complete="off" placeholder="请输入防火防盗"></el-input> | ||
| 76 | + </el-form-item> | ||
| 77 | + <el-form-item label="可疑人员" prop="doubtfulPerson"> | ||
| 78 | + <el-input v-model="editForm.doubtfulPerson" auto-complete="off" placeholder="请输入可疑人员"></el-input> | ||
| 79 | + </el-form-item> | ||
| 80 | + <el-form-item label="违规停放车辆" prop="violationsCar"> | ||
| 81 | + <el-input v-model="editForm.violationsCar" auto-complete="off" placeholder="请输入违规停放车辆"></el-input> | ||
| 82 | + </el-form-item> | ||
| 83 | + <el-form-item label="施工人员" prop="builders"> | ||
| 84 | + <el-input v-model="editForm.builders" auto-complete="off" placeholder="请输入施工人员"></el-input> | ||
| 85 | + </el-form-item> | ||
| 86 | + <el-form-item label="其他情况" prop="otherSituations"> | ||
| 87 | + <el-input v-model="editForm.otherSituations" auto-complete="off" placeholder="请输入其他情况"></el-input> | ||
| 88 | + </el-form-item> | ||
| 89 | + <el-form-item label="操作时间" prop="securityInspectionDate"> | ||
| 90 | + <span class="demonstration">默认</span> | ||
| 91 | + <el-date-picker | ||
| 92 | + v-model="editForm.securityInspectionDate" | ||
| 93 | + type="datetime" | ||
| 94 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 95 | + placeholder="选择日期时间"> | ||
| 96 | + </el-date-picker> | ||
| 97 | + </el-form-item> | ||
| 98 | + </el-form> | ||
| 99 | + <div slot="footer" class="dialog-footer"> | ||
| 100 | + <el-button @click.native="editFormVisible = false">取消</el-button> | ||
| 101 | + <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button> | ||
| 102 | + </div> | ||
| 103 | + </el-dialog> | ||
| 104 | + | ||
| 105 | + <!--新增界面--> | ||
| 106 | + <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> | ||
| 107 | + <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm"> | ||
| 108 | + <el-form-item label="安检巡视员" prop="securityInspectionName"> | ||
| 109 | + <el-input v-model="addForm.securityInspectionName" auto-complete="off" placeholder="请输入安检巡视员"></el-input> | ||
| 110 | + </el-form-item> | ||
| 111 | + <el-form-item label="消防通道及隔离设备" prop="fireName"> | ||
| 112 | + <el-input v-model="addForm.fireName" auto-complete="off" placeholder="请输入消防通道及隔离设备"></el-input> | ||
| 113 | + </el-form-item> | ||
| 114 | + <el-form-item label="安全用电" prop="securityElectro"> | ||
| 115 | + <el-input v-model="addForm.securityElectro" auto-complete="off" placeholder="请输入安全用电"></el-input> | ||
| 116 | + </el-form-item> | ||
| 117 | + <el-form-item label="防火防盗" prop="fireproofing"> | ||
| 118 | + <el-input v-model="addForm.fireproofing" auto-complete="off" placeholder="请输入防火防盗"></el-input> | ||
| 119 | + </el-form-item> | ||
| 120 | + <el-form-item label="可疑人员" prop="doubtfulPerson"> | ||
| 121 | + <el-input v-model="addForm.doubtfulPerson" auto-complete="off" placeholder="请输入可疑人员"></el-input> | ||
| 122 | + </el-form-item> | ||
| 123 | + <el-form-item label="违规停放车辆" prop="violationsCar"> | ||
| 124 | + <el-input v-model="addForm.violationsCar" auto-complete="off" placeholder="请输入违规停放车辆"></el-input> | ||
| 125 | + </el-form-item> | ||
| 126 | + <el-form-item label="施工人员" prop="builders"> | ||
| 127 | + <el-input v-model="addForm.builders" auto-complete="off" placeholder="请输入施工人员"></el-input> | ||
| 128 | + </el-form-item> | ||
| 129 | + <el-form-item label="其他情况" prop="otherSituations"> | ||
| 130 | + <el-input v-model="addForm.otherSituations" auto-complete="off" placeholder="请输入其他情况"></el-input> | ||
| 131 | + </el-form-item> | ||
| 132 | + <el-form-item label="操作时间" prop="securityInspectionDate"> | ||
| 133 | + <el-date-picker | ||
| 134 | + v-model="addForm.securityInspectionDate" | ||
| 135 | + type="datetime" | ||
| 136 | + value-format="yyyy-MM-dd HH:mm:ss" | ||
| 137 | + placeholder="选择日期时间"> | ||
| 138 | + </el-date-picker> | ||
| 139 | + </el-form-item> | ||
| 140 | + </el-form> | ||
| 141 | + <div slot="footer" class="dialog-footer"> | ||
| 142 | + <el-button @click.native="addFormVisible = false">取消</el-button> | ||
| 143 | + <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> | ||
| 144 | + </div> | ||
| 145 | + </el-dialog> | ||
| 146 | + </section> | ||
| 147 | +</template> | ||
| 148 | + | ||
| 149 | +<script> | ||
| 150 | + import util from '../../common/js/util' | ||
| 151 | + import NProgress from 'nprogress' | ||
| 152 | + import { getList, remove, batchRemove, edit, add } from '../../api/staff/security_inspection'; | ||
| 153 | + import moment from 'moment' | ||
| 154 | + | ||
| 155 | + export default { | ||
| 156 | + data() { | ||
| 157 | + return { | ||
| 158 | + filters: { | ||
| 159 | + securityInspectionName: '' | ||
| 160 | + }, | ||
| 161 | + userId: '', | ||
| 162 | + securityInspectionList: [], | ||
| 163 | + total: 0, | ||
| 164 | + pageNum: 1, | ||
| 165 | + pageSize: 5, | ||
| 166 | + listLoading: false, | ||
| 167 | + sels: [],//列表选中列 | ||
| 168 | + //编辑界面是否显示 | ||
| 169 | + editFormVisible: false, | ||
| 170 | + editLoading: false, | ||
| 171 | + editFormRules: { | ||
| 172 | + securityInspectionName: [ | ||
| 173 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 174 | + ], | ||
| 175 | + securityInspectionDate: [ | ||
| 176 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 177 | + ], | ||
| 178 | + fireName: [ | ||
| 179 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 180 | + ], | ||
| 181 | + securityElectro: [ | ||
| 182 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 183 | + ], | ||
| 184 | + fireproofing: [ | ||
| 185 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 186 | + ], | ||
| 187 | + doubtfulPerson: [ | ||
| 188 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 189 | + ], | ||
| 190 | + violationsCar: [ | ||
| 191 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 192 | + ], | ||
| 193 | + builders: [ | ||
| 194 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 195 | + ], | ||
| 196 | + otherSituations: [ | ||
| 197 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 198 | + ], | ||
| 199 | + }, | ||
| 200 | + //编辑界面数据 | ||
| 201 | + editForm: { | ||
| 202 | + securityInspectionId: '', | ||
| 203 | + securityInspectionName: '', | ||
| 204 | + securityInspectionDate: '', | ||
| 205 | + fireName: '', | ||
| 206 | + securityElectro: '', | ||
| 207 | + fireproofing: '', | ||
| 208 | + doubtfulPerson: '', | ||
| 209 | + violationsCar: '', | ||
| 210 | + builders: '', | ||
| 211 | + otherSituations: '' | ||
| 212 | + }, | ||
| 213 | + //新增界面是否显示 | ||
| 214 | + addFormVisible: false, | ||
| 215 | + addLoading: false, | ||
| 216 | + addFormRules: { | ||
| 217 | + securityInspectionName: [ | ||
| 218 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 219 | + ], | ||
| 220 | + fireName: [ | ||
| 221 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 222 | + ], | ||
| 223 | + securityElectro: [ | ||
| 224 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 225 | + ], | ||
| 226 | + fireproofing: [ | ||
| 227 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 228 | + ], | ||
| 229 | + doubtfulPerson: [ | ||
| 230 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 231 | + ], | ||
| 232 | + violationsCar: [ | ||
| 233 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 234 | + ], | ||
| 235 | + builders: [ | ||
| 236 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 237 | + ], | ||
| 238 | + otherSituations: [ | ||
| 239 | + { required: true, message: '不能为空!!!', trigger: 'blur' } | ||
| 240 | + ], | ||
| 241 | + }, | ||
| 242 | + | ||
| 243 | + //新增界面数据 | ||
| 244 | + addForm: { | ||
| 245 | + securityInspectionName: '', | ||
| 246 | +// securityInspectionDate: '', | ||
| 247 | + fireName: '', | ||
| 248 | + securityElectro: '', | ||
| 249 | + fireproofing: '', | ||
| 250 | + doubtfulPerson: '', | ||
| 251 | + violationsCar: '', | ||
| 252 | + builders: '', | ||
| 253 | + otherSituations: '', | ||
| 254 | + optTime:'', | ||
| 255 | + realname:'', | ||
| 256 | + userId: this.userId | ||
| 257 | + } | ||
| 258 | + } | ||
| 259 | + }, | ||
| 260 | + mounted() { | ||
| 261 | + this.userId = JSON.parse(sessionStorage.getItem('user')).userId; | ||
| 262 | + console.log(this.userId); | ||
| 263 | + this.getSecurityInspectionList(); | ||
| 264 | + | ||
| 265 | + }, | ||
| 266 | + methods: { | ||
| 267 | + | ||
| 268 | + handleCurrentChange(val) { | ||
| 269 | + this.pageNum = val; | ||
| 270 | + this.getSecurityInspectionList(); | ||
| 271 | + }, | ||
| 272 | + //获取公司列表 | ||
| 273 | + getSecurityInspectionList() { | ||
| 274 | + let para = { | ||
| 275 | + pageNum: this.pageNum, | ||
| 276 | + pageSize: this.pageSize, | ||
| 277 | + securityInspectionName: this.filters.securityInspectionName | ||
| 278 | + }; | ||
| 279 | + this.listLoading = true; | ||
| 280 | + //NProgress.start(); | ||
| 281 | + getList(para).then((res) => { | ||
| 282 | + this.total = res.data.total; | ||
| 283 | + this.securityInspectionList = res.data.list; | ||
| 284 | + this.listLoading = false; | ||
| 285 | + //NProgress.done(); | ||
| 286 | + }).catch((error) => { | ||
| 287 | + | ||
| 288 | + this.listLoading = false; | ||
| 289 | + if(null!= error.response && error.response!==undefined){ | ||
| 290 | + let status= error.response.status; | ||
| 291 | + let msg = error.response.statusText; | ||
| 292 | + alert(status+msg); | ||
| 293 | + }else { | ||
| 294 | + alert(error); | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + }); | ||
| 298 | + | ||
| 299 | + }, | ||
| 300 | + | ||
| 301 | + | ||
| 302 | + //删除 | ||
| 303 | + handleDel: function (index, row) { | ||
| 304 | + this.$confirm('确认删除该记录吗?', '提示', { | ||
| 305 | + type: 'warning' | ||
| 306 | + }).then(() => { | ||
| 307 | + this.listLoading = true; | ||
| 308 | + //NProgress.start(); | ||
| 309 | + let para = { securityInspectionId: row.securityInspectionId }; | ||
| 310 | + remove(para).then((res) => { | ||
| 311 | + this.listLoading = false; | ||
| 312 | + //NProgress.done(); | ||
| 313 | + this.$message({ | ||
| 314 | + message: '删除成功', | ||
| 315 | + type: 'success' | ||
| 316 | + }); | ||
| 317 | + this.getSecurityInspectionList(); | ||
| 318 | + }).catch((error) => { | ||
| 319 | + this.listLoading = false; | ||
| 320 | + alert(error); | ||
| 321 | + }); | ||
| 322 | + }).catch(); | ||
| 323 | + }, | ||
| 324 | + /** | ||
| 325 | + * 显示编辑界面 | ||
| 326 | + * @param index | ||
| 327 | + * @param row 为这行的数据对象 | ||
| 328 | + */ | ||
| 329 | + handleEdit: function (index, row) { | ||
| 330 | + this.editFormVisible = true; | ||
| 331 | + this.editForm = Object.assign({}, row); | ||
| 332 | + this.getSecurityInspectionList(); | ||
| 333 | + }, | ||
| 334 | + //显示新增界面,每次点开初始化数据 | ||
| 335 | + companyAdd: function () { | ||
| 336 | + this.addFormVisible = true; | ||
| 337 | + this.addForm = { | ||
| 338 | + userId: this.userId | ||
| 339 | + }; | ||
| 340 | + this.getSecurityInspectionList(); | ||
| 341 | + }, | ||
| 342 | + | ||
| 343 | + //新增 | ||
| 344 | + addSubmit: function () { | ||
| 345 | + this.$refs.addForm.validate((valid) => { | ||
| 346 | + if (valid) { | ||
| 347 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 348 | + //NProgress.start(); | ||
| 349 | + this.listLoading = true; | ||
| 350 | + let para = Object.assign({}, this.addForm); | ||
| 351 | + add(para).then((res) => { | ||
| 352 | + this.addLoading = false; | ||
| 353 | + //NProgress.done(); | ||
| 354 | + this.$message({ | ||
| 355 | + message: '提交成功', | ||
| 356 | + type: 'success' | ||
| 357 | + }); | ||
| 358 | + this.$refs['addForm'].resetFields(); | ||
| 359 | + this.addFormVisible = false; | ||
| 360 | + this.getSecurityInspectionList(); | ||
| 361 | + }).catch(error => alert(error)); | ||
| 362 | + }); | ||
| 363 | + } | ||
| 364 | + }); | ||
| 365 | + }, | ||
| 366 | + //编辑 | ||
| 367 | + editSubmit: function () { | ||
| 368 | + this.$refs.editForm.validate((valid) => { | ||
| 369 | + if (valid) { | ||
| 370 | + this.$confirm('确认提交吗?', '提示', {}).then(() => { | ||
| 371 | + this.editLoading = true; | ||
| 372 | + let para = Object.assign({}, this.editForm); | ||
| 373 | + this.editLoading = true; | ||
| 374 | + edit(para).then((res) => { | ||
| 375 | + | ||
| 376 | + this.$message({ | ||
| 377 | + message: '提交成功', | ||
| 378 | + type: 'success' | ||
| 379 | + }); | ||
| 380 | + this.$refs['editForm'].resetFields(); | ||
| 381 | + this.editFormVisible = false; | ||
| 382 | + this.getSecurityInspectionList(); | ||
| 383 | + }).catch(error => alert(error)); | ||
| 384 | + }); | ||
| 385 | + } | ||
| 386 | + }); | ||
| 387 | + }, | ||
| 388 | + | ||
| 389 | + selsChange: function (sels) { | ||
| 390 | + this.sels = sels; | ||
| 391 | + }, | ||
| 392 | + //批量删除 | ||
| 393 | + batchRemove: function () { | ||
| 394 | + var ids = this.sels.map(item => item.securityInspectionId).toString(); | ||
| 395 | + this.$confirm('确认删除选中记录吗?', '提示', { | ||
| 396 | + type: 'warning' | ||
| 397 | + }).then(() => { | ||
| 398 | + this.listLoading = true; | ||
| 399 | + //NProgress.start(); | ||
| 400 | + let para = { ids: ids }; | ||
| 401 | + batchRemove(para).then((res) => { | ||
| 402 | + this.listLoading = false; | ||
| 403 | + //NProgress.done(); | ||
| 404 | + this.$message({ | ||
| 405 | + message: '删除成功', | ||
| 406 | + type: 'success' | ||
| 407 | + }); | ||
| 408 | + this.getSecurityInspectionList(); | ||
| 409 | + }); | ||
| 410 | + }).catch(() => { | ||
| 411 | + | ||
| 412 | + }); | ||
| 413 | + } | ||
| 414 | + }, | ||
| 415 | + | ||
| 416 | + } | ||
| 417 | +</script> |
-
请 注册 或 登录 后发表评论