Browse Source

完成ic卡页面

hzj18279462576@163.com 3 years ago
parent
commit
fe4de9e247
100 changed files with 989 additions and 666 deletions
  1. 0 0
      .babelrc
  2. 0 0
      .editorconfig
  3. 0 0
      .eslintignore
  4. 0 0
      .eslintrc.js
  5. 0 0
      .gitignore
  6. 0 0
      .postcssrc.js
  7. 0 0
      README.md
  8. 0 100
      admin/build/webpack.dev.conf.js
  9. BIN
      admin/dist.zip
  10. 0 59
      admin/src/api/api.js
  11. 0 27
      admin/src/api/hotelStaff.js
  12. 0 31
      admin/src/api/icCard.js
  13. 0 124
      admin/src/router/index.js
  14. 0 0
      build/build.js
  15. 0 0
      build/check-versions.js
  16. 0 0
      build/logo.png
  17. 0 0
      build/utils.js
  18. 0 0
      build/vue-loader.conf.js
  19. 0 0
      build/webpack.base.conf.js
  20. 110 0
      build/webpack.dev.conf.js
  21. 0 0
      build/webpack.prod.conf.js
  22. 0 0
      config/dev.env.js
  23. 19 18
      admin/config/index.js
  24. 0 0
      config/prod.env.js
  25. 0 0
      config/test.env.js
  26. 0 0
      index.html
  27. 0 0
      package-lock.json
  28. 0 0
      package.json
  29. 0 0
      src/App.vue
  30. 0 0
      src/api/acl/permission.js
  31. 0 0
      src/api/acl/role.js
  32. 0 0
      src/api/acl/user.js
  33. 59 0
      src/api/api.js
  34. 0 0
      src/api/doorLock.js
  35. 0 0
      src/api/fileServes.js
  36. 31 0
      src/api/fingerprint.js
  37. 0 0
      src/api/hotelAdmin.js
  38. 0 0
      src/api/hotelOrder.js
  39. 32 0
      src/api/hotelStaff.js
  40. 0 0
      src/api/houseType.js
  41. 31 0
      src/api/icCard.js
  42. 0 0
      src/api/normalUser.js
  43. 0 0
      src/api/room.js
  44. 0 0
      src/api/roomRealTimeStatu.js
  45. 0 0
      src/api/roomThirdSetting.js
  46. 0 0
      src/api/stat.js
  47. 0 0
      src/api/systemSetup.js
  48. 0 0
      src/api/systemnotice.js
  49. 0 0
      src/assets/icons/svg/account-active.svg
  50. 0 0
      src/assets/icons/svg/account.svg
  51. 0 0
      src/assets/icons/svg/edit.svg
  52. 0 0
      src/assets/icons/svg/error.svg
  53. 0 0
      src/assets/icons/svg/home-active.svg
  54. 0 0
      src/assets/icons/svg/home.svg
  55. 0 0
      src/assets/icons/svg/item-logo.svg
  56. 0 0
      src/assets/icons/svg/order-active.svg
  57. 0 0
      src/assets/icons/svg/order.svg
  58. 0 0
      src/assets/icons/svg/quit.svg
  59. 0 0
      src/assets/icons/svg/sousuo.svg
  60. 0 0
      src/assets/icons/svg/staff-active.svg
  61. 0 0
      src/assets/icons/svg/staff.svg
  62. 0 0
      src/assets/icons/svg/stat-active.svg
  63. 0 0
      src/assets/icons/svg/stat.svg
  64. 0 0
      src/assets/icons/svg/system-active.svg
  65. 0 0
      src/assets/icons/svg/system.svg
  66. 0 0
      src/assets/icons/svg/tuifang.svg
  67. 0 0
      src/assets/icons/svg/xiaoxizhongxin.svg
  68. 0 0
      src/assets/images/bg.png
  69. 0 0
      src/assets/images/eye.png
  70. 0 0
      src/assets/images/eye_close.png
  71. 0 0
      src/assets/images/password.png
  72. 0 0
      src/assets/images/user.png
  73. 0 0
      src/assets/scss/variable.scss
  74. 0 0
      src/components/SvgIcon/index.vue
  75. 0 0
      src/layout/components/Navbar.vue
  76. 0 0
      src/layout/components/NavbarItem.vue
  77. 0 0
      src/layout/index.vue
  78. 0 0
      src/main.js
  79. 156 0
      src/router/index.js
  80. 0 0
      src/store/getters.js
  81. 0 0
      src/store/index.js
  82. 0 0
      src/store/modules/inform.js
  83. 0 0
      src/store/modules/user.js
  84. 0 0
      src/utils/auth.js
  85. 0 0
      src/utils/http.js
  86. 0 0
      src/utils/request.js
  87. 0 0
      src/utils/rsa.js
  88. 0 0
      src/views/account/index.vue
  89. 187 137
      admin/src/views/fingerprint/index.vue
  90. 93 32
      admin/src/views/home/index.vue
  91. 227 79
      admin/src/views/icCard/index.vue
  92. 0 0
      src/views/inform/index.vue
  93. 0 21
      admin/src/views/login/index.vue
  94. 0 0
      src/views/order/index.vue
  95. 44 38
      admin/src/views/staff/index.vue
  96. 0 0
      src/views/stat/index.vue
  97. 0 0
      src/views/system/index.vue
  98. 0 0
      static/.gitkeep
  99. 0 0
      test/e2e/custom-assertions/elementCount.js
  100. 0 0
      admin/test/e2e/nightwatch.conf.js

admin/.babelrc → .babelrc


admin/.editorconfig → .editorconfig


admin/.eslintignore → .eslintignore


admin/.eslintrc.js → .eslintrc.js


admin/.gitignore → .gitignore


admin/.postcssrc.js → .postcssrc.js


admin/README.md → README.md


+ 0 - 100
admin/build/webpack.dev.conf.js

@@ -1,100 +0,0 @@
-'use strict'
-const utils = require('./utils')
-const webpack = require('webpack')
-const config = require('../config')
-const merge = require('webpack-merge')
-const path = require('path')
-const baseWebpackConfig = require('./webpack.base.conf')
-const CopyWebpackPlugin = require('copy-webpack-plugin')
-const HtmlWebpackPlugin = require('html-webpack-plugin')
-const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
-const portfinder = require('portfinder')
-
-const HOST = process.env.HOST
-const PORT = process.env.PORT && Number(process.env.PORT)
-
-const devWebpackConfig = merge(baseWebpackConfig, {
-  module: {
-    rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
-  },
-  // cheap-module-eval-source-map is faster for development
-  devtool: config.dev.devtool,
-
-  // these devServer options should be customized in /config/index.js
-  devServer: {
-    clientLogLevel: 'warning',
-    historyApiFallback: {
-      rewrites: [
-        { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
-      ],
-    },
-    useLocalIp: true, //将useLoackIp设置为true 就可以了
-    hot: true,
-    contentBase: false, // since we use CopyWebpackPlugin.
-    compress: true,
-    host: HOST || config.dev.host,
-    port: PORT || config.dev.port,
-    open: config.dev.autoOpenBrowser,
-    overlay: config.dev.errorOverlay
-      ? { warnings: false, errors: true }
-      : false,
-    publicPath: config.dev.assetsPublicPath,
-    proxy: config.dev.proxyTable,
-    quiet: true, // necessary for FriendlyErrorsPlugin
-    watchOptions: {
-      poll: config.dev.poll,
-    }
-  },
-  plugins: [
-    new webpack.DefinePlugin({
-      'process.env': require('../config/dev.env')
-    }),
-    new webpack.HotModuleReplacementPlugin(),
-    new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
-    new webpack.NoEmitOnErrorsPlugin(),
-    // https://github.com/ampedandwired/html-webpack-plugin
-    new HtmlWebpackPlugin({
-      filename: 'index.html',
-      template: 'index.html',
-      inject: true
-    }),
-    // copy custom static assets
-    new CopyWebpackPlugin([
-      {
-        from: path.resolve(__dirname, '../static'),
-        to: config.dev.assetsSubDirectory,
-        ignore: ['.*']
-      }
-    ])
-  ]
-})
-
-module.exports = new Promise((resolve, reject) => {
-  portfinder.basePort = process.env.PORT || config.dev.port
-  portfinder.getPort((err, port) => {
-    if (err) {
-      reject(err)
-    } else {
-      // publish the new Port, necessary for e2e tests
-      process.env.PORT = port
-      // add port to devServer config
-      devWebpackConfig.devServer.port = port
-
-      // Add FriendlyErrorsPlugin
-      devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
-        compilationSuccessInfo: {
-          messages: [ //下面两个地方,直接复制即可
-            `App runing at: `,
-            ` - Local: http://localhost:${port}`, //配置这里
-            ` - Network: http://${require('ip').address()}:${port}`,//配置这里
-          ],
-        },
-        onErrors: config.dev.notifyOnErrors
-          ? utils.createNotifierCallback()
-          : undefined
-      }))
-
-      resolve(devWebpackConfig)
-    }
-  })
-})

BIN
admin/dist.zip


+ 0 - 59
admin/src/api/api.js

@@ -1,59 +0,0 @@
-// import http from '../utils/http'
-import * as doorLock from './doorLock'
-import * as fileServes from './fileServes'
-import * as hotelOrder from './hotelOrder'
-import * as hotelAdmin from './hotelAdmin'
-import * as hotelStaff from './hotelStaff'
-import * as houseType from './houseType'
-import * as normalUser from './normalUser'
-import * as room from './room'
-import * as systemnotice from './systemnotice'
-import * as systemSetup from './systemSetup'
-import * as roomRealTimeStatu from './roomRealTimeStatu'
-import * as roomThirdSetting from './roomThirdSetting'
-import * as icCard from './icCard'
-import * as stat from './stat'
-// 
-/**
- *  @parms resquest 请求地址 例如:http://197.82.15.15:8088/request/...
- *  @param '/testIp'代表vue-cil中config,index.js中配置的代理
- */
-// let resquest = "/api/ihotel"
-
-// get请求
-// export function getListAPI(params) {
-//     return http.get(`${resquest}/getList.json`, params)
-// }
-
-// // post请求
-// export function postFormAPI(params) {
-//     return http.post(`${resquest}/postForm.json`, params)
-// }
-
-// // put 请求
-// export function putSomeAPI(params) {
-//     return http.put(`${resquest}/putSome.json`, params)
-// }
-// // delete 请求
-// export function deleteListAPI(params) {
-//     return http.delete(`${resquest}/deleteList.json`, params)
-// }
-
-export default {
-    doorLock,      // 门锁
-    fileServes,    // 文件服务
-    hotelOrder,    // 酒店订单
-    hotelAdmin,    // 酒店管理员
-    hotelStaff,    // 酒店员工
-    houseType,     // 房型
-    normalUser,    // 普通用户
-    room,          // 房间
-    systemnotice,  // 系统通知
-    systemSetup,    // 系统设置
-    roomRealTimeStatu,  // 实时房态
-    roomThirdSetting,   // 房间第三方平台设置
-    icCard, // IC卡
-    stat,// 统计报表
-};
-
-

+ 0 - 27
admin/src/api/hotelStaff.js

@@ -1,27 +0,0 @@
-import http from '../utils/http'
-let resquest = "/hotel/ihotel-api/ihotel/ihotel/hotelStaff"
-
-// 员工列表
-export function hotelStaffList(params) {
-    return http.get(`${resquest}/list`, params)
-}
-
-// 员工信息
-export function hotelStaffInfo(id, params) {
-    return http.get(`${resquest}/info/${id}`, params)
-}
-
-// 新增员工
-export function hotelStaffSave(params) {
-    return http.post(`${resquest}/save`, params)
-}
-
-// 修改管理员
-export function hotelStaffUpdate(data) {
-    return http.put(`${resquest}/update`, data)
-}
-
-// 删除管理员
-export function hotelStaffDelete(data) {
-    return http.delete(`${resquest}/delete`, data)
-}

+ 0 - 31
admin/src/api/icCard.js

@@ -1,31 +0,0 @@
-import http from '../utils/http'
-let resquest = "/hotel/ihotel-api/ihotel/condition"
-
-// IC卡查询
-export function icqueryInfo(params) {
-    return http.get(`${resquest}/ic/queryInfo/${params}`)
-}
-
-// IC卡查询-详情
-export function queryICInfoById(params) {
-    return http.get(`${resquest}/ic/queryICInfoById`, params)
-}
-
-//  IC卡新增
-export function add(params) {
-    return http.post(`${resquest}/ic/add`, params)
-}
-//  IC卡修改
-export function update(params) {
-    return http.post(`${resquest}/ic/update`, params)
-}
-
-// IC卡解绑
-export function unbundIC(params) {
-    return http.get(`${resquest}/ic/unbundIC`, params)
-}
-
-// IC卡导出详情
-export function downLoadICInfo(params) {
-    return http.get(`${resquest}/downLoadICInfo`, params, '', 'blob')
-}

+ 0 - 124
admin/src/router/index.js

@@ -1,124 +0,0 @@
-import Vue from 'vue'
-
-import Router from 'vue-router'
-import Layout from '@/layout'
-import store from "@/store"
-import Cookies from 'js-cookie'
-Vue.use(Router)
-//不管是超级管理员还是普通用户都可以看到的页面 
-export const constantRoutes = [
-    // 登录页
-    {
-        path: '/login',
-        // meta: { isAuth: true },
-        component: () => import('@/views/login/index'),
-        hidden: true
-    },
-    {
-        path: '/',
-        name: 'Layout',
-        redirect: '/login',
-        alwaysShow: true,
-        component: Layout,
-        children: [
-            // {
-            //     path: 'home',
-            //     name: 'Home',
-            //     meta: {
-            //         isAuth: true,
-            //         title: '主页',
-            //         keepAlive: true //缓存组件 
-            //     },
-            //     component: () => import('@/views/home'),
-            // },
-            // {
-            //     path: 'account',
-            //     name: 'account',
-            //     meta: { isAuth: true, title: '账号管理' },
-            //     component: () => import('@/views/account')
-            // },
-            {
-                path: 'inform',
-                name: 'Inform',
-                meta: { isAuth: true, title: '系统通知' },
-                component: () => import('@/views/inform')
-            },
-            {
-                path: 'home/ICcard',
-                name: 'icCard',
-                meta: { isAuth: true, title: 'IC卡管理' },
-                component: () => import('@/views/icCard')
-            },
-            {
-                path: 'home/fingerprint',
-                name: 'fingerprint',
-                meta: { isAuth: true, title: '指纹管理' },
-                component: () => import('@/views/fingerprint')
-            }
-        ]
-    },
-    // {
-    //     path: '*',
-    //     redirect: '/login',
-    //     // meta: { isAuth: true },
-    //     // component: () => import('@/views/login/index'),
-    //     hidden: true
-    // }
-
-]
-const router = new Router({
-    mode: 'history', // require service support
-    scrollBehavior: () => ({ y: 0 }),
-    routes: constantRoutes
-})
-
-export default router
-
-//全局前置路由守卫————初始化的时候被调用、每次路由切换之前被调用
-router.beforeEach((to, from, next) => {
-    console.log(store);
-    if (to.meta.isAuth) {
-        //判断 如果cook是否存在,可以进去
-        if (Cookies.get('cook') == store.state.user.token) {
-            console.log(1111)
-            next()  //放行
-        } else {
-            // alert('登录身份失效,请重新登录')
-            // router.addRoute("Layout", {
-            //     path: item,
-            //     name: item,
-            //     meta: { isAuth: true },
-            //     component: () => import(`@/views/${item}`),
-            // });
-            console.log(22222);
-            next({ path: "/login" })
-        }
-    } else {
-        // 否则,放行
-        console.log(3333);
-        if (Cookies.get('cook')) {
-            if (store.state.user.statRoutes[0].children.length === 3) {
-                // console.log(rsaPassWord);
-                store.dispatch("user/login", {
-                    username: Cookies.get('user'),
-                    password: Cookies.get('password')
-                })
-                    .then(() => {
-                        next({ ...to })
-                        // next()
-                    })
-                    .catch((error) => {
-                        next()
-                    });
-
-            } else {
-                next()
-            }
-        } else {
-            next()
-        }
-
-        // next()
-
-    }
-})

admin/build/build.js → build/build.js


admin/build/check-versions.js → build/check-versions.js


admin/build/logo.png → build/logo.png


admin/build/utils.js → build/utils.js


admin/build/vue-loader.conf.js → build/vue-loader.conf.js


admin/build/webpack.base.conf.js → build/webpack.base.conf.js


+ 110 - 0
build/webpack.dev.conf.js

@@ -0,0 +1,110 @@
+"use strict";
+const utils = require("./utils");
+const webpack = require("webpack");
+const config = require("../config");
+const merge = require("webpack-merge");
+const path = require("path");
+const baseWebpackConfig = require("./webpack.base.conf");
+const CopyWebpackPlugin = require("copy-webpack-plugin");
+const HtmlWebpackPlugin = require("html-webpack-plugin");
+const FriendlyErrorsPlugin = require("friendly-errors-webpack-plugin");
+const portfinder = require("portfinder");
+
+const HOST = process.env.HOST;
+const PORT = process.env.PORT && Number(process.env.PORT);
+
+const devWebpackConfig = merge(baseWebpackConfig, {
+  module: {
+    rules: utils.styleLoaders({
+      sourceMap: config.dev.cssSourceMap,
+      usePostCSS: true
+    })
+  },
+  // cheap-module-eval-source-map is faster for development
+  devtool: config.dev.devtool,
+
+  // these devServer options should be customized in /config/index.js
+  devServer: {
+    clientLogLevel: "warning",
+    historyApiFallback: {
+      rewrites: [
+        {
+          from: /.*/,
+          to: path.posix.join(config.dev.assetsPublicPath, "index.html")
+        }
+      ]
+    },
+    // useLocalIp: true, //将useLoackIp设置为true 就可以了
+    hot: true,
+    contentBase: false, // since we use CopyWebpackPlugin.
+    compress: true,
+    host: HOST || config.dev.host,
+    port: PORT || config.dev.port,
+    open: config.dev.autoOpenBrowser,
+    overlay: config.dev.errorOverlay
+      ? { warnings: false, errors: true }
+      : false,
+    publicPath: config.dev.assetsPublicPath,
+    proxy: config.dev.proxyTable,
+    quiet: true, // necessary for FriendlyErrorsPlugin
+    watchOptions: {
+      poll: config.dev.poll
+    }
+  },
+  plugins: [
+    new webpack.DefinePlugin({
+      "process.env": require("../config/dev.env")
+    }),
+    new webpack.HotModuleReplacementPlugin(),
+    new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
+    new webpack.NoEmitOnErrorsPlugin(),
+    // https://github.com/ampedandwired/html-webpack-plugin
+    new HtmlWebpackPlugin({
+      filename: "index.html",
+      template: "index.html",
+      inject: true
+    }),
+    // copy custom static assets
+    new CopyWebpackPlugin([
+      {
+        from: path.resolve(__dirname, "../static"),
+        to: config.dev.assetsSubDirectory,
+        ignore: [".*"]
+      }
+    ])
+  ]
+});
+
+module.exports = new Promise((resolve, reject) => {
+  portfinder.basePort = process.env.PORT || config.dev.port;
+  portfinder.getPort((err, port) => {
+    if (err) {
+      reject(err);
+    } else {
+      // publish the new Port, necessary for e2e tests
+      process.env.PORT = port;
+      // add port to devServer config
+      devWebpackConfig.devServer.port = port;
+
+      // Add FriendlyErrorsPlugin
+      devWebpackConfig.plugins.push(
+        new FriendlyErrorsPlugin({
+          compilationSuccessInfo: {
+            messages: [
+              //下面两个地方,直接复制即可
+              `App runing at: `,
+              ` - Local: http://localhost:${port}`, //配置这里
+              ` - Network: http://${require("ip").address()}:${port}` //配置这里
+            ]
+            // messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
+          },
+          onErrors: config.dev.notifyOnErrors
+            ? utils.createNotifierCallback()
+            : undefined
+        })
+      );
+
+      resolve(devWebpackConfig);
+    }
+  });
+});

admin/build/webpack.prod.conf.js → build/webpack.prod.conf.js


admin/config/dev.env.js → config/dev.env.js


+ 19 - 18
admin/config/index.js

@@ -1,31 +1,32 @@
-'use strict'
+"use strict";
 // Template version: 1.3.1
 // Template version: 1.3.1
 // see http://vuejs-templates.github.io/webpack for documentation.
 // see http://vuejs-templates.github.io/webpack for documentation.
 
 
-const path = require('path')
+const path = require("path");
 
 
 module.exports = {
 module.exports = {
   dev: {
   dev: {
     // http://192.168.161.34:8089线下地址
     // http://192.168.161.34:8089线下地址
     // https://chtech.ncjti.edu.cn/hotel/ihotel-api线上地址
     // https://chtech.ncjti.edu.cn/hotel/ihotel-api线上地址
     // Paths
     // Paths
-    assetsSubDirectory: 'static',
-    assetsPublicPath: '/hotel/manage/',
+    assetsSubDirectory: "static",
+    assetsPublicPath: "/hotel/manage/",
     proxyTable: {
     proxyTable: {
-      '/hotel/ihotel-api': {
+      "/hotel/ihotel-api": {
         // target: 'http://192.168.161.34:8089',
         // target: 'http://192.168.161.34:8089',
-        target: 'https://chtech.ncjti.edu.cn/hotel/ihotel-api',
-        secure: false,// 这是签名认证,http和https区分的参数设置
+        target: "https://chtech.ncjti.edu.cn/hotel/ihotel-api",
+        secure: false, // 这是签名认证,http和https区分的参数设置
         changeOrigin: true,
         changeOrigin: true,
         pathRewrite: {
         pathRewrite: {
-          '^/hotel/ihotel-api': ''
+          "^/hotel/ihotel-api": ""
         }
         }
       }
       }
     },
     },
 
 
     // Various Dev Server settings
     // Various Dev Server settings
-    host: '0.0.0.0', // can be overwritten by process.env.HOST
-    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+    host: "0.0.0.0", // can be overwritten by process.env.HOST
+    // host: "localhost",
+    port: 8899, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     autoOpenBrowser: false,
     errorOverlay: true,
     errorOverlay: true,
     notifyOnErrors: true,
     notifyOnErrors: true,
@@ -44,7 +45,7 @@ module.exports = {
      */
      */
 
 
     // https://webpack.js.org/configuration/devtool/#development
     // https://webpack.js.org/configuration/devtool/#development
-    devtool: 'cheap-module-eval-source-map',
+    devtool: "cheap-module-eval-source-map",
 
 
     // If you have problems debugging vue-files in devtools,
     // If you have problems debugging vue-files in devtools,
     // set this to false - it *may* help
     // set this to false - it *may* help
@@ -56,12 +57,12 @@ module.exports = {
 
 
   build: {
   build: {
     // Template for index.html
     // Template for index.html
-    index: path.resolve(__dirname, '../dist/index.html'),
+    index: path.resolve(__dirname, "../dist/index.html"),
 
 
     // Paths
     // Paths
-    assetsRoot: path.resolve(__dirname, '../dist'),
-    assetsSubDirectory: 'static',
-    assetsPublicPath: '/hotel/manage/',
+    assetsRoot: path.resolve(__dirname, "../dist"),
+    assetsSubDirectory: "static",
+    assetsPublicPath: "/hotel/manage/",
 
 
     /**
     /**
      * Source Maps
      * Source Maps
@@ -69,14 +70,14 @@ module.exports = {
 
 
     productionSourceMap: true,
     productionSourceMap: true,
     // https://webpack.js.org/configuration/devtool/#production
     // https://webpack.js.org/configuration/devtool/#production
-    devtool: '#source-map',
+    devtool: "#source-map",
 
 
     // Gzip off by default as many popular static hosts such as
     // Gzip off by default as many popular static hosts such as
     // Surge or Netlify already gzip all static assets for you.
     // Surge or Netlify already gzip all static assets for you.
     // Before setting to `true`, make sure to:
     // Before setting to `true`, make sure to:
     // npm install --save-dev compression-webpack-plugin
     // npm install --save-dev compression-webpack-plugin
     productionGzip: false,
     productionGzip: false,
-    productionGzipExtensions: ['js', 'css'],
+    productionGzipExtensions: ["js", "css"],
 
 
     // Run the build command with an extra argument to
     // Run the build command with an extra argument to
     // View the bundle analyzer report after build finishes:
     // View the bundle analyzer report after build finishes:
@@ -84,4 +85,4 @@ module.exports = {
     // Set to `true` or `false` to always turn it on or off
     // Set to `true` or `false` to always turn it on or off
     bundleAnalyzerReport: process.env.npm_config_report
     bundleAnalyzerReport: process.env.npm_config_report
   }
   }
-}
+};

admin/config/prod.env.js → config/prod.env.js


admin/config/test.env.js → config/test.env.js


admin/index.html → index.html


admin/package-lock.json → package-lock.json


admin/package.json → package.json


admin/src/App.vue → src/App.vue


admin/src/api/acl/permission.js → src/api/acl/permission.js


admin/src/api/acl/role.js → src/api/acl/role.js


admin/src/api/acl/user.js → src/api/acl/user.js


+ 59 - 0
src/api/api.js

@@ -0,0 +1,59 @@
+// import http from '../utils/http'
+import * as doorLock from "./doorLock";
+import * as fileServes from "./fileServes";
+import * as hotelOrder from "./hotelOrder";
+import * as hotelAdmin from "./hotelAdmin";
+import * as hotelStaff from "./hotelStaff";
+import * as houseType from "./houseType";
+import * as normalUser from "./normalUser";
+import * as room from "./room";
+import * as systemnotice from "./systemnotice";
+import * as systemSetup from "./systemSetup";
+import * as roomRealTimeStatu from "./roomRealTimeStatu";
+import * as roomThirdSetting from "./roomThirdSetting";
+import * as icCard from "./icCard";
+import * as fingerprint from "./fingerprint";
+import * as stat from "./stat";
+//
+/**
+ *  @parms resquest 请求地址 例如:http://197.82.15.15:8088/request/...
+ *  @param '/testIp'代表vue-cil中config,index.js中配置的代理
+ */
+// let resquest = "/api/ihotel"
+
+// get请求
+// export function getListAPI(params) {
+//     return http.get(`${resquest}/getList.json`, params)
+// }
+
+// // post请求
+// export function postFormAPI(params) {
+//     return http.post(`${resquest}/postForm.json`, params)
+// }
+
+// // put 请求
+// export function putSomeAPI(params) {
+//     return http.put(`${resquest}/putSome.json`, params)
+// }
+// // delete 请求
+// export function deleteListAPI(params) {
+//     return http.delete(`${resquest}/deleteList.json`, params)
+// }
+
+export default {
+  doorLock, // 门锁
+  fileServes, // 文件服务
+  hotelOrder, // 酒店订单
+  hotelAdmin, // 酒店管理员
+  hotelStaff, // 酒店员工
+  houseType, // 房型
+  normalUser, // 普通用户
+  room, // 房间
+  systemnotice, // 系统通知
+  systemSetup, // 系统设置
+  roomRealTimeStatu, // 实时房态
+  roomThirdSetting, // 房间第三方平台设置
+  icCard, // IC卡
+  stat, // 统计报表
+  fingerprint // 指纹
+};

admin/src/api/doorLock.js → src/api/doorLock.js


admin/src/api/fileServes.js → src/api/fileServes.js


+ 31 - 0
src/api/fingerprint.js

@@ -0,0 +1,31 @@
+import http from "../utils/http";
+let resquest = "/hotel/ihotel-api/ihotel/condition/fingerprint";
+
+// fingerprint查询
+export function queryInfo(params) {
+  return http.get(`${resquest}/queryInfo/${params}`);
+}
+
+// IC卡查询-详情
+export function queryICInfoById(params) {
+  return http.get(`${resquest}/ic/queryICInfoById`, params);
+}
+
+// 指纹新增
+export function add(params) {
+  return http.post(`${resquest}/add`, params);
+}
+//  指纹修改
+export function update(params) {
+  return http.post(`${resquest}/ic/update`, params);
+}
+
+// 指纹解绑
+export function unbundIC(params) {
+  return http.get(`${resquest}/ic/unbundIC`, params);
+}
+
+// 指纹导出详情
+export function downLoadICInfo(params) {
+  return http.get(`${resquest}/downLoadICInfo`, params, "", "blob");
+}

admin/src/api/hotelAdmin.js → src/api/hotelAdmin.js


admin/src/api/hotelOrder.js → src/api/hotelOrder.js


+ 32 - 0
src/api/hotelStaff.js

@@ -0,0 +1,32 @@
+import http from "../utils/http";
+let resquest = "/hotel/ihotel-api/ihotel/ihotel/hotelStaff";
+
+// 员工列表
+export function hotelStaffList(params) {
+  return http.get(`${resquest}/list`, params);
+}
+
+// 员工信息
+export function hotelStaffInfo(id, params) {
+  return http.get(`${resquest}/info/${id}`, params);
+}
+
+// 新增员工
+export function hotelStaffSave(params) {
+  return http.post(`${resquest}/save`, params);
+}
+
+// 修改管理员
+export function hotelStaffUpdate(data) {
+  return http.put(`${resquest}/update`, data);
+}
+
+// 删除管理员
+export function hotelStaffDelete(data) {
+  return http.delete(`${resquest}/delete`, data);
+}
+
+// 员工类型和员工
+export function departList(params) {
+  return http.get(`${resquest}/departList`, params);
+}

admin/src/api/houseType.js → src/api/houseType.js


+ 31 - 0
src/api/icCard.js

@@ -0,0 +1,31 @@
+import http from "../utils/http";
+let resquest = "/hotel/ihotel-api/ihotel/condition";
+
+// IC卡查询
+export function icqueryInfo(params) {
+  return http.get(`${resquest}/ic/queryInfo/${params}`);
+}
+
+// IC卡查询-详情
+export function queryICInfoById(params) {
+  return http.get(`${resquest}/ic/queryICInfoById`, params);
+}
+
+//  IC卡新增
+export function add(params) {
+  return http.post(`${resquest}/ic/add`, params);
+}
+//  IC卡修改
+export function update(params) {
+  return http.post(`${resquest}/ic/update`, params);
+}
+
+// IC卡解绑
+export function unbundIC(params) {
+  return http.get(`${resquest}/ic/unbundIC`, params);
+}
+
+// IC卡导出详情
+export function downLoadICInfo(params) {
+  return http.get(`${resquest}/downLoadICInfo`, params, "", "blob");
+}

admin/src/api/normalUser.js → src/api/normalUser.js


admin/src/api/room.js → src/api/room.js


admin/src/api/roomRealTimeStatu.js → src/api/roomRealTimeStatu.js


admin/src/api/roomThirdSetting.js → src/api/roomThirdSetting.js


admin/src/api/stat.js → src/api/stat.js


admin/src/api/systemSetup.js → src/api/systemSetup.js


admin/src/api/systemnotice.js → src/api/systemnotice.js


admin/src/assets/icons/svg/account-active.svg → src/assets/icons/svg/account-active.svg


admin/src/assets/icons/svg/account.svg → src/assets/icons/svg/account.svg


admin/src/assets/icons/svg/edit.svg → src/assets/icons/svg/edit.svg


admin/src/assets/icons/svg/error.svg → src/assets/icons/svg/error.svg


admin/src/assets/icons/svg/home-active.svg → src/assets/icons/svg/home-active.svg


admin/src/assets/icons/svg/home.svg → src/assets/icons/svg/home.svg


admin/src/assets/icons/svg/item-logo.svg → src/assets/icons/svg/item-logo.svg


admin/src/assets/icons/svg/order-active.svg → src/assets/icons/svg/order-active.svg


admin/src/assets/icons/svg/order.svg → src/assets/icons/svg/order.svg


admin/src/assets/icons/svg/quit.svg → src/assets/icons/svg/quit.svg


admin/src/assets/icons/svg/sousuo.svg → src/assets/icons/svg/sousuo.svg


admin/src/assets/icons/svg/staff-active.svg → src/assets/icons/svg/staff-active.svg


admin/src/assets/icons/svg/staff.svg → src/assets/icons/svg/staff.svg


admin/src/assets/icons/svg/stat-active.svg → src/assets/icons/svg/stat-active.svg


admin/src/assets/icons/svg/stat.svg → src/assets/icons/svg/stat.svg


admin/src/assets/icons/svg/system-active.svg → src/assets/icons/svg/system-active.svg


admin/src/assets/icons/svg/system.svg → src/assets/icons/svg/system.svg


admin/src/assets/icons/svg/tuifang.svg → src/assets/icons/svg/tuifang.svg


admin/src/assets/icons/svg/xiaoxizhongxin.svg → src/assets/icons/svg/xiaoxizhongxin.svg


admin/src/assets/images/bg.png → src/assets/images/bg.png


admin/src/assets/images/eye.png → src/assets/images/eye.png


admin/src/assets/images/eye_close.png → src/assets/images/eye_close.png


admin/src/assets/images/password.png → src/assets/images/password.png


admin/src/assets/images/user.png → src/assets/images/user.png


admin/src/assets/scss/variable.scss → src/assets/scss/variable.scss


admin/src/components/SvgIcon/index.vue → src/components/SvgIcon/index.vue


admin/src/layout/components/Navbar.vue → src/layout/components/Navbar.vue


admin/src/layout/components/NavbarItem.vue → src/layout/components/NavbarItem.vue


admin/src/layout/index.vue → src/layout/index.vue


admin/src/main.js → src/main.js


+ 156 - 0
src/router/index.js

@@ -0,0 +1,156 @@
+import Vue from 'vue'
+
+import Router from 'vue-router'
+import Layout from '@/layout'
+import store from "@/store"
+import Cookies from 'js-cookie'
+Vue.use(Router)
+//不管是超级管理员还是普通用户都可以看到的页面 
+export const constantRoutes = [
+    // 登录页
+    {
+        path: '/login',
+        // meta: { isAuth: true },
+        component: () => import('@/views/login/index'),
+        hidden: true
+    },
+    {
+        path: '/',
+        name: 'Layout',
+        // redirect: '/login',
+        // alwaysShow: true,
+        component: Layout,
+        children: [
+            {
+                path: 'inform',
+                name: 'Inform',
+                meta: { isAuth: true, title: '系统通知' },
+                component: () => import('@/views/inform')
+            },
+            {
+                path: 'home/ICcard',
+                name: 'icCard',
+                meta: { isAuth: true, title: 'IC卡管理' },
+                component: () => import('@/views/icCard')
+            },
+            {
+                path: 'home/fingerprint',
+                name: 'fingerprint',
+                meta: { isAuth: true, title: '指纹管理' },
+                component: () => import('@/views/fingerprint')
+            }
+        ]
+    },
+    // {
+    //     path: '*',
+    //     redirect: '/login',
+    //     // meta: { isAuth: true },
+    //     // component: () => import('@/views/login/index'),
+    //     hidden: true
+    // }
+
+]
+const router = new Router({
+    // mode: 'history', // require service support
+    scrollBehavior: () => ({ y: 0 }),
+    routes: constantRoutes
+})
+
+export default router
+router.beforeEach((to, from, next) => {
+    //判断 如果cook是否存在,可以进去
+    if (Cookies.get('cook') == store.state.user.token) {
+        console.log(1111)
+        next()  //放行
+    } else {
+
+        if (to.path === '/') {
+            console.log(3333);
+            next({ path: '/login' })
+        } else {
+            console.log(4444444);
+            if (Cookies.get('cook') && store.state.user.statRoutes[0].children.length === 3) {
+                // console.log(rsaPassWord);
+                store.dispatch("user/login", {
+                    username: Cookies.get('user'),
+                    password: Cookies.get('password')
+                })
+                    .then(() => {
+                        console.log('重新请求token');
+                        next({ ...to })
+                    })
+                    .catch((error) => {
+                        console.log('重新请求失败');
+                        Cookies.remove('cook')
+                    });
+
+            } else {
+                console.log(666666);
+                console.log(to);
+                if (to.path !== '/login') {
+                    next({ path: '/login' })
+                } else {
+                    next()
+                }
+
+            }
+        }
+    }
+
+
+})
+
+
+
+//全局前置路由守卫————初始化的时候被调用、每次路由切换之前被调用
+// router.beforeEach((to, from, next) => {
+//     console.log('000000');
+//     if (to.meta.isAuth) {
+//         //判断 如果cook是否存在,可以进去
+//         if (Cookies.get('cook') == store.state.user.token) {
+//             console.log(1111)
+//             next()  //放行
+//         } else {
+//             // alert('登录身份失效,请重新登录')
+//             // router.addRoute("Layout", {
+//             //     path: item,
+//             //     name: item,
+//             //     meta: { isAuth: true },
+//             //     component: () => import(`@/views/${item}`),
+//             // });
+//             console.log(22222);
+//             next({ path: "/login" })
+//         }
+//     } else {
+//         // 否则,放行
+//         console.log(3333);
+//         if (Cookies.get('cook')) {
+//             if (store.state.user.statRoutes[0].children.length === 3) {
+//                 // console.log(rsaPassWord);
+//                 store.dispatch("user/login", {
+//                     username: Cookies.get('user'),
+//                     password: Cookies.get('password')
+//                 })
+//                     .then(() => {
+//                         console.log(444444);
+//                         next({ ...to })
+//                         // next()
+//                     })
+//                     .catch((error) => {
+//                         console.log(55555);
+//                         next()
+//                     });
+
+//             } else {
+//                 console.log(666666);
+//                 next()
+//             }
+//         } else {
+//             console.log(777777);
+//             next()
+//         }
+
+//         // next()
+
+//     }
+// })

admin/src/store/getters.js → src/store/getters.js


admin/src/store/index.js → src/store/index.js


admin/src/store/modules/inform.js → src/store/modules/inform.js


admin/src/store/modules/user.js → src/store/modules/user.js


admin/src/utils/auth.js → src/utils/auth.js


admin/src/utils/http.js → src/utils/http.js


admin/src/utils/request.js → src/utils/request.js


admin/src/utils/rsa.js → src/utils/rsa.js


admin/src/views/account/index.vue → src/views/account/index.vue


+ 187 - 137
admin/src/views/fingerprint/index.vue

@@ -17,16 +17,49 @@
           <!-- 订单号筛选 -->
           <!-- 订单号筛选 -->
           <div class="inquire">
           <div class="inquire">
             <el-input
             <el-input
-              placeholder="请输入订单号"
+              placeholder="指纹编码/IC卡号/姓名"
               style="width: 261px"
               style="width: 261px"
               clearable
               clearable
-              v-model="value"
+              v-model="queryValue"
               @clear="getData(1)"
               @clear="getData(1)"
             >
             >
               <i slot="prefix" class="el-input__icon el-icon-search"></i>
               <i slot="prefix" class="el-input__icon el-icon-search"></i>
             </el-input>
             </el-input>
             <el-button @click="getData(1)">查询</el-button>
             <el-button @click="getData(1)">查询</el-button>
           </div>
           </div>
+          <div class="paydate">
+            <span class="demonstration">创建时间:</span>
+            <el-date-picker
+              v-model="createTime"
+              type="date"
+              placeholder="选择日期"
+              value-format="yyyy-MM-dd"
+              @change="getData(1)"
+            ></el-date-picker>
+          </div>
+
+          <!-- 支付时间筛选 -->
+          <div class="paydate">
+            <span class="demonstration">用户类型:</span>
+            <!-- <el-input
+              placeholder="请输入订单号"
+              style="width: 261px"
+              clearable
+              v-model="value"
+              @clear="getData(1)"
+            >
+              <i slot="prefix" class="el-input__icon el-icon-search"></i>
+            </el-input>-->
+            <el-select
+              v-model="userType"
+              clearable
+              placeholder="请选择类型"
+              @change="getData(1)"
+            >
+              <el-option label="普通用户" value="2"></el-option>
+              <el-option label="管理员" value="1"></el-option>
+            </el-select>
+          </div>
           <div class="add">
           <div class="add">
             <div class="export" @click="addCard">新增</div>
             <div class="export" @click="addCard">新增</div>
             <el-dialog
             <el-dialog
@@ -167,10 +200,22 @@
                           <span>指 纹</span>
                           <span>指 纹</span>
                           <i
                           <i
                             class="el-icon-close"
                             class="el-icon-close"
-                            @click="fingerprintShow = false"
+                            @click="closefingerprintShow"
                           ></i>
                           ></i>
                         </div>
                         </div>
-                        <div class="el-footer"></div>
+                        <div class="el-footer">
+                          <div style="height:350px;margin: 30px auto;">
+                            <el-steps direction="vertical" :active="stepindex">
+                              <el-step title="步骤 1"></el-step>
+                              <el-step title="步骤 2"></el-step>
+                              <el-step title="步骤 3"></el-step>
+                              <el-step
+                                title="步骤 4"
+                                description="录取成功"
+                              ></el-step>
+                            </el-steps>
+                          </div>
+                        </div>
                       </el-dialog>
                       </el-dialog>
                     </el-form-item>
                     </el-form-item>
                     <el-form-item label="失效时间">
                     <el-form-item label="失效时间">
@@ -216,18 +261,13 @@
             :cell-style="rowbg"
             :cell-style="rowbg"
             :header-cell-style="{
             :header-cell-style="{
               color: ' rgba(0, 0, 0, 1)',
               color: ' rgba(0, 0, 0, 1)',
-              background: 'rgba(240, 243, 247, 1)',
+              background: 'rgba(240, 243, 247, 1)'
             }"
             }"
           >
           >
             <el-table-column
             <el-table-column
-              type="selection"
-              width="60"
-              align="center"
-            ></el-table-column>
-            <el-table-column
-              prop="order.orderNo"
+              prop="roomNo"
               width="120"
               width="120"
-              label="号"
+              label="房间号"
               align="center"
               align="center"
               show-overflow-tooltip
               show-overflow-tooltip
             >
             >
@@ -237,49 +277,47 @@
               width="200"
               width="200"
               align="center"
               align="center"
               label="房间号(锁设备UID)"
               label="房间号(锁设备UID)"
+              show-overflow-tooltip
+              prop="lockUserId"
             >
             >
-              <template slot-scope="{ row }">
-                {{ options[row.order.orderStatu].label }}
-              </template>
             </el-table-column>
             </el-table-column>
 
 
             <el-table-column
             <el-table-column
-              prop="order.roomNo"
-              width="160"
+              prop="createTime"
+              width="200"
               align="center"
               align="center"
               label="生效时间"
               label="生效时间"
             >
             >
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="electricity"
+              prop="failureTime"
               align="center"
               align="center"
-              width="130"
+              width="200"
               label="失效时间"
               label="失效时间"
             >
             >
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="water"
+              prop="holderName"
               width="130"
               width="130"
               align="center"
               align="center"
               label="持卡人姓名"
               label="持卡人姓名"
             >
             >
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="imprest"
+              prop="fingerprintNumber"
               align="center"
               align="center"
               width="150"
               width="150"
-              label="收预付款(元)"
+              label="指纹编码"
+              show-overflow-tooltip
             >
             >
             </el-table-column>
             </el-table-column>
-            <el-table-column
-              prop="refund"
-              width="150"
-              align="center"
-              label="用户类型"
-            >
+            <el-table-column width="150" align="center" label="用户类型">
+              <template slot-scope="{ row }">
+                <span>{{ row.userType == 1 ? "管理员" : "普通用户" }}</span>
+              </template>
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
-              prop="order.createTime"
+              prop="createTime"
               width="180"
               width="180"
               align="center"
               align="center"
               label="创建时间"
               label="创建时间"
@@ -474,110 +512,58 @@ export default {
         roomId: "",
         roomId: "",
         cardId: "",
         cardId: "",
         name: "",
         name: "",
-        radio: "一个星期",
+        radio: "一个星期"
       },
       },
       startTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
       startTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
-      endTime: dayjs(new Date()).add(7, "day").format("YYYY-MM-DD HH:mm:ss"),
+      endTime: dayjs(new Date())
+        .add(7, "day")
+        .format("YYYY-MM-DD HH:mm:ss"),
       // 指纹录入弹窗属性
       // 指纹录入弹窗属性
       fingerprintShow: false,
       fingerprintShow: false,
+      stepindex: 0, // 录取指纹步骤
+      roomNo: "", // 房间号
 
 
       // 员工弹窗属性
       // 员工弹窗属性
       selectStaffShow: false,
       selectStaffShow: false,
       defaultProps: {
       defaultProps: {
         children: "children",
         children: "children",
-        label: "label",
+        label: "label"
       },
       },
       title: "",
       title: "",
-      data: [
-        {
-          id: 1,
-          label: "清洁部",
-          disabled: true,
-          children: [
-            {
-              id: 4,
-              label: "张三",
-            },
-            {
-              id: 5,
-              label: "张三",
-            },
-            {
-              id: 6,
-              label: "张三",
-            },
-            {
-              id: 7,
-              label: "张三",
-            },
-          ],
-        },
-        {
-          id: 2,
-          label: "修理部",
-          disabled: true,
-          children: [
-            {
-              id: 8,
-              label: "李四",
-            },
-            {
-              id: 9,
-              label: "李四",
-            },
-          ],
-        },
-        {
-          id: 3,
-          label: "管理部",
-          disabled: true,
-          children: [
-            {
-              id: 10,
-              label: "王五",
-            },
-            {
-              id: 11,
-              label: "王五",
-            },
-          ],
-        },
-      ],
+      data: [],
       // 状态数组
       // 状态数组
       options: [
       options: [
         {
         {
           value: 0,
           value: 0,
-          label: "已取消",
+          label: "已取消"
         },
         },
         {
         {
           value: 1,
           value: 1,
-          label: "待支付",
+          label: "待支付"
         },
         },
         {
         {
           value: 2,
           value: 2,
-          label: "待入住",
+          label: "待入住"
         },
         },
         {
         {
           value: 3,
           value: 3,
-          label: "已入住",
+          label: "已入住"
         },
         },
         {
         {
           value: 4,
           value: 4,
-          label: "待结账",
+          label: "待结账"
         },
         },
         {
         {
           value: 5,
           value: 5,
-          label: "已完成",
-        },
+          label: "已完成"
+        }
       ],
       ],
       // 筛选状态绑定数据
       // 筛选状态绑定数据
-      state: "",
+      userType: "",
       // 筛选订单号绑定数据
       // 筛选订单号绑定数据
-      value: "",
-      // 筛选支付时间绑定数据
-      payTime: [],
+      queryValue: "",
       // 筛选创建时间绑定数据
       // 筛选创建时间绑定数据
-      createTime: [],
+      createTime: "",
       // 弹窗控制属性
       // 弹窗控制属性
       dialogVisible: false,
       dialogVisible: false,
       waterTable: [],
       waterTable: [],
@@ -588,7 +574,7 @@ export default {
       // 每页条数
       // 每页条数
       pageSize: 8,
       pageSize: 8,
       // 总条数
       // 总条数
-      total: null,
+      total: null
     };
     };
   },
   },
   watch: {
   watch: {
@@ -598,41 +584,31 @@ export default {
         this.endTime = "";
         this.endTime = "";
       }
       }
       this.icCardInfo.radio = "";
       this.icCardInfo.radio = "";
-    },
+    }
+  },
+  watch: {
+    stepindex(newVal, oldVal) {
+      console.log(newVal);
+      this.stepindex = newVal;
+    }
   },
   },
   mounted() {
   mounted() {
+    this.roomNo = JSON.parse(sessionStorage.getItem("roomNo"));
     this.getData();
     this.getData();
   },
   },
   methods: {
   methods: {
     // 返回首页
     // 返回首页
     goBack() {
     goBack() {
       this.$router.replace({
       this.$router.replace({
-        name: "Home",
+        name: "Home"
       });
       });
     },
     },
     // 获取表格数据
     // 获取表格数据
-    async getData(curPage) {
-      if (curPage) {
-        this.curPage = curPage;
-      }
-      if (!this.createTime) {
-        this.createTime = [];
-      }
-      if (!this.payTime) {
-        this.payTime = [];
-      }
-      let params = {
-        curPage: this.curPage,
-        pageSize: this.pageSize,
-        statu: this.state,
-        orderNo: this.value,
-        payTime1: this.payTime[0],
-        payTime2: this.payTime[1],
-        createTime1: this.createTime[0],
-        createTime2: this.createTime[1],
-      };
-      let res = await this.API.hotelOrder.hotelOrderAdminPage(params);
-      // console.log(res);
+    async getData() {
+      let params = "";
+      params = `${this.roomNo}?curPage=${this.curPage}&pageSize=${this.pageSize}&keyWord=${this.queryValue}&createTime=${this.createTime}&userType=${this.userType}`;
+      let res = await this.API.fingerprint.queryInfo(params);
+      console.log(res, "指纹管理");
       if (res.success) {
       if (res.success) {
         this.tableData = res.data.list;
         this.tableData = res.data.list;
         this.total = res.data.totalCount;
         this.total = res.data.totalCount;
@@ -647,11 +623,13 @@ export default {
     endT() {
     endT() {
       if (
       if (
         this.endTime <
         this.endTime <
-        dayjs(this.startTime).add(1, "day").format("YYYY-MM-DD HH:mm:ss")
+        dayjs(this.startTime)
+          .add(1, "day")
+          .format("YYYY-MM-DD HH:mm:ss")
       ) {
       ) {
         this.$message({
         this.$message({
           message: "失效日期应大于生效日期至少一天",
           message: "失效日期应大于生效日期至少一天",
-          type: "error",
+          type: "error"
         });
         });
         this.endTime = "";
         this.endTime = "";
       }
       }
@@ -684,6 +662,77 @@ export default {
     //指纹录入
     //指纹录入
     fingerprin() {
     fingerprin() {
       this.fingerprintShow = true;
       this.fingerprintShow = true;
+      let _this = this;
+      var wsUrl = "ws://localhost:8181/";
+      let websocket = new WebSocket(wsUrl);
+      websocket.onopen = function(evt) {
+        var params = { type: 101, data: null };
+        websocket.send(JSON.stringify(params));
+      };
+
+      websocket.onmessage = function(evt) {
+        console.log(evt.data, "输出数据");
+        let data = JSON.parse(evt.data);
+
+        if (data.type == 0) {
+          console.log("检测到设备");
+          let params1 = {
+            type: 1,
+            data: {
+              type: 0,
+              portName: "COM3",
+              baudRate: 115200
+            }
+          };
+          websocket.send(JSON.stringify(params1));
+        } else if (data.type == 110) {
+          console.log("已获取设备信息");
+        } else if (data.type == 11) {
+          var params2 = {
+            type: 2,
+            data: {
+              totalStep: 4
+            }
+          };
+          websocket.send(JSON.stringify(params2));
+        } else if (data.type == 21) {
+          if (data.data.step == 0) {
+            console.log("请按压指纹");
+          } else {
+            console.log(`请按下同一指纹,第${data.data.step}次按压`);
+            _this.stepindex = data.data.step;
+          }
+          // _this.$message.warning("请将手指按在传感器上");
+          if (data.data.step > 4) {
+            var params = {
+              type: 3,
+              data: {
+                id: data.data.id
+              }
+            };
+            websocket.send(JSON.stringify(params));
+          }
+        } else if (data.type == 31) {
+          _this.icCardInfo.cardId = data.data.template;
+          _this.$message.success("指纹录取成功");
+          _this.fingerprintShow = false;
+        } else {
+          _this.$message.error("设备连接失败,请刷新重新录入");
+        }
+      };
+      websocket.onclose = function(evt) {
+        console.log("关闭连接");
+      };
+      websocket.onerror = function(evt) {
+        console.log("错误提示");
+      };
+    },
+
+    // 关闭指纹录入
+    closefingerprintShow() {
+      var wsUrl = "ws://localhost:8181/";
+      const websocket = new WebSocket(wsUrl);
+      this.fingerprintShow = false;
     },
     },
     //员工弹窗
     //员工弹窗
     Editstaff() {
     Editstaff() {
@@ -695,8 +744,8 @@ export default {
       this.count = [
       this.count = [
         {
         {
           id: data.id,
           id: data.id,
-          label: data.label,
-        },
+          label: data.label
+        }
       ];
       ];
       // console.log(this.count);
       // console.log(this.count);
       this.$refs.roomTree.setCheckedNodes(this.count);
       this.$refs.roomTree.setCheckedNodes(this.count);
@@ -732,7 +781,7 @@ export default {
       let wbout = XLSX.write(wb, {
       let wbout = XLSX.write(wb, {
         bookType: "xlsx",
         bookType: "xlsx",
         bookSST: true,
         bookSST: true,
-        type: "array",
+        type: "array"
       });
       });
       try {
       try {
         FileSaver.saveAs(
         FileSaver.saveAs(
@@ -763,7 +812,7 @@ export default {
           allowance: null,
           allowance: null,
           cost:
           cost:
             row.orderBill.priceOfWater *
             row.orderBill.priceOfWater *
-            (row.orderBill.endOfWater - row.orderBill.startOfWater),
+            (row.orderBill.endOfWater - row.orderBill.startOfWater)
         });
         });
 
 
         electricTemList.push({
         electricTemList.push({
@@ -775,7 +824,7 @@ export default {
           allowance: null,
           allowance: null,
           cost:
           cost:
             row.orderBill.priceOfElectric *
             row.orderBill.priceOfElectric *
-            (row.orderBill.endOfElectric - row.orderBill.startOfElectric),
+            (row.orderBill.endOfElectric - row.orderBill.startOfElectric)
         });
         });
         this.waterTable = waterTemList;
         this.waterTable = waterTemList;
         this.electricTable = electricTemList;
         this.electricTable = electricTemList;
@@ -825,8 +874,8 @@ export default {
       if (row.rowIndex % 2 != 0) {
       if (row.rowIndex % 2 != 0) {
         return { background: "rgba(240, 243, 247, 1)", "border-radius": "5px" };
         return { background: "rgba(240, 243, 247, 1)", "border-radius": "5px" };
       }
       }
-    },
-  },
+    }
+  }
 };
 };
 </script>
 </script>
 
 
@@ -1272,15 +1321,16 @@ export default {
     display: none;
     display: none;
   }
   }
   .el-dialog__body {
   .el-dialog__body {
-    border-bottom: 0.5px solid #ccc;
-    padding: 15px 10px;
+    padding: 0;
     .elbody {
     .elbody {
       display: flex;
       display: flex;
       justify-content: space-between;
       justify-content: space-between;
       align-items: center;
       align-items: center;
-      margin: 0 20px;
+      padding: 20px 20px;
       font-size: 18px;
       font-size: 18px;
       color: #000;
       color: #000;
+      border-bottom: 0.5px solid #ccc;
+
       i {
       i {
         cursor: pointer;
         cursor: pointer;
       }
       }
@@ -1299,4 +1349,4 @@ export default {
     background-color: #296de3;
     background-color: #296de3;
   }
   }
 }
 }
-</style>
+</style>

+ 93 - 32
admin/src/views/home/index.vue

@@ -1,4 +1,4 @@
-<template >
+<template>
   <el-card class="box-card">
   <el-card class="box-card">
     <div slot="header" class="clearfix">
     <div slot="header" class="clearfix">
       <div class="header-left">
       <div class="header-left">
@@ -7,16 +7,24 @@
       </div>
       </div>
       <div class="header-right">
       <div class="header-right">
         <el-input
         <el-input
-          placeholder="请输入房间号  如:1-1-1001"
+          placeholder="请输入房间号  如:17-1-1-1001"
           prefix-icon="el-icon-search"
           prefix-icon="el-icon-search"
           class="inquire-input"
           class="inquire-input"
           v-model="inquireValue"
           v-model="inquireValue"
         ></el-input>
         ></el-input>
         <el-button class="inquire-button" @click="inquireRoom">查询</el-button>
         <el-button class="inquire-button" @click="inquireRoom">查询</el-button>
         <div class="control" style="margin-left: 17px">
         <div class="control" style="margin-left: 17px">
-          <div class="title" @click="roomAll" style="cursor: pointer">批量开关房</div>
+          <div class="title" @click="roomAll" style="cursor: pointer">
+            批量开关房
+          </div>
           <ul v-show="room">
           <ul v-show="room">
-            <li @click="dialogShow" v-for="(item, index) in titles2" :key="index">{{ item }}</li>
+            <li
+              @click="dialogShow"
+              v-for="(item, index) in titles2"
+              :key="index"
+            >
+              {{ item }}
+            </li>
             <el-dialog
             <el-dialog
               :title="title"
               :title="title"
               :visible.sync="dialogVisible"
               :visible.sync="dialogVisible"
@@ -26,10 +34,15 @@
             >
             >
               <div class="tree">
               <div class="tree">
                 <div class="tree-left">
                 <div class="tree-left">
-                  <el-checkbox v-model="checked" style="margin-left: 15px" @change="chooseAll">全选</el-checkbox>
-                  <span
-                    style="margin-left: 165px"
-                  >{{ count.length }} / {{ data[0].children.length }}</span>
+                  <el-checkbox
+                    v-model="checked"
+                    style="margin-left: 15px"
+                    @change="chooseAll"
+                    >全选</el-checkbox
+                  >
+                  <span style="margin-left: 165px"
+                    >{{ count.length }} / {{ data[0].children.length }}</span
+                  >
                 </div>
                 </div>
                 <el-tree
                 <el-tree
                   :data="data"
                   :data="data"
@@ -80,28 +93,45 @@
             </div>
             </div>
             <div class="main-floor">
             <div class="main-floor">
               <div class="room-num" v-for="item in items.room" :key="item.id">
               <div class="room-num" v-for="item in items.room" :key="item.id">
-                <el-popover placement="right" trigger="click" popper-class="popperOptions">
+                <el-popover
+                  placement="right"
+                  trigger="click"
+                  popper-class="popperOptions"
+                >
                   <div class="control-room">
                   <div class="control-room">
-                    <el-button size="mini" @click="closeRoom(item)" :disabled="item.statu != 1">关房</el-button>
+                    <el-button
+                      size="mini"
+                      @click="closeRoom(item)"
+                      :disabled="item.statu != 1"
+                      >关房</el-button
+                    >
                     <el-button
                     <el-button
                       size="mini"
                       size="mini"
                       @click="todirty(item)"
                       @click="todirty(item)"
                       :disabled="item.statu == 4 || item.statu == 5"
                       :disabled="item.statu == 4 || item.statu == 5"
-                    >转脏房</el-button>
+                      >转脏房</el-button
+                    >
                     <el-button
                     <el-button
                       size="mini"
                       size="mini"
                       :disabled="item.statu != 4 && item.statu != 5"
                       :disabled="item.statu != 4 && item.statu != 5"
                       @click="leisure(item)"
                       @click="leisure(item)"
-                    >转空闲</el-button>
-                    <el-button size="mini" @click="closeEle(item)">{{ item.electricName }}</el-button>
+                      >转空闲</el-button
+                    >
+                    <el-button size="mini" @click="closeEle(item)">{{
+                      item.electricName
+                    }}</el-button>
                     <!-- <el-button
                     <!-- <el-button
                       size="mini"
                       size="mini"
                       :disabled="item.statuName != '脏房'"
                       :disabled="item.statuName != '脏房'"
                       @click="leisure(item)"
                       @click="leisure(item)"
                       >清扫</el-button
                       >清扫</el-button
                     >-->
                     >-->
-                    <el-button size="mini" @click="ICpage(item.roomNo)">IC卡</el-button>
-                    <el-button size="mini" @click="fingerprintPage">指纹</el-button>
+                    <el-button size="mini" @click="ICpage(item.roomNo)"
+                      >IC卡</el-button
+                    >
+                    <el-button size="mini" @click="fingerprintPage(item.roomNo)"
+                      >指纹</el-button
+                    >
                   </div>
                   </div>
                   <div
                   <div
                     @click="EachRoom($event, item)"
                     @click="EachRoom($event, item)"
@@ -114,12 +144,16 @@
                         <span style="font-size: 16px">{{ item.build }}栋</span>
                         <span style="font-size: 16px">{{ item.build }}栋</span>
                         {{ item.roomNo.slice(3) }}
                         {{ item.roomNo.slice(3) }}
                       </span>
                       </span>
-                      <div class="state" :style="bgState(item.statu)">{{ item.statuName }}</div>
+                      <div class="state" :style="bgState(item.statu)">
+                        {{ item.statuName }}
+                      </div>
                     </div>
                     </div>
-                    <template v-if="item.statu == 2">
+                    <template v-if="item.statu == 2 || item.statu == 3">
+                      <!--显示房间所属人信息 -->
                       <div class="teacher">{{ item.useInfo.userName }}</div>
                       <div class="teacher">{{ item.useInfo.userName }}</div>
                       <div class="num">
                       <div class="num">
-                        <span>水:{{ item.useInfo.startOfWater }}吨</span>&nbsp;&nbsp;
+                        <span>水:{{ item.useInfo.startOfWater }}吨</span
+                        >&nbsp;&nbsp;
                         <span>电:{{ item.useInfo.startOfElectric }}度</span>
                         <span>电:{{ item.useInfo.startOfElectric }}度</span>
                       </div>
                       </div>
                       <div class="count-down">
                       <div class="count-down">
@@ -195,7 +229,10 @@
                       </div>
                       </div>
                       <div class="roomblock">
                       <div class="roomblock">
                         <span>电表编码:</span>
                         <span>电表编码:</span>
-                        <div class="number" v-if="doorLockList.electricityIdshow">
+                        <div
+                          class="number"
+                          v-if="doorLockList.electricityIdshow"
+                        >
                           <span>{{ doorLockList.electricityId }}</span>
                           <span>{{ doorLockList.electricityId }}</span>
                           <div @click="editEle">
                           <div @click="editEle">
                             <IconSvg :W="16" :H="16" name="edit" />
                             <IconSvg :W="16" :H="16" name="edit" />
@@ -212,9 +249,15 @@
                     <div class="roomID">
                     <div class="roomID">
                       <div class="roompassword">
                       <div class="roompassword">
                         <span>门锁密码:</span>
                         <span>门锁密码:</span>
-                        <div class="sendpass" v-for="item in roomPassWord" :key="item.id">
+                        <div
+                          class="sendpass"
+                          v-for="item in roomPassWord"
+                          :key="item.id"
+                        >
                           <span>{{ item.lockRealtimePassword }}</span>
                           <span>{{ item.lockRealtimePassword }}</span>
-                          <span class="password" @click="sending(item)">下发密码</span>
+                          <span class="password" @click="sending(item)"
+                            >下发密码</span
+                          >
                           <span style="margin-left: 10px">
                           <span style="margin-left: 10px">
                             密码到期时间 :
                             密码到期时间 :
                             {{ item.endTime.replace("T", " ") }}
                             {{ item.endTime.replace("T", " ") }}
@@ -223,8 +266,12 @@
                       </div>
                       </div>
                     </div>
                     </div>
                     <span slot="footer" class="dialog-footer">
                     <span slot="footer" class="dialog-footer">
-                      <el-button @click.stop="lockClose(item)" size="mini">取消</el-button>
-                      <el-button size="mini" @click.stop="UpdataRoom(item)">完成</el-button>
+                      <el-button @click.stop="lockClose(item)" size="mini"
+                        >取消</el-button
+                      >
+                      <el-button size="mini" @click.stop="UpdataRoom(item)"
+                        >完成</el-button
+                      >
                     </span>
                     </span>
                   </el-dialog>
                   </el-dialog>
                 </div>
                 </div>
@@ -260,7 +307,8 @@
                 :indeterminate="isIndeterminate"
                 :indeterminate="isIndeterminate"
                 v-model="checkAll"
                 v-model="checkAll"
                 @change="handleCheckAllChange"
                 @change="handleCheckAllChange"
-              >全选</el-checkbox>
+                >全选</el-checkbox
+              >
               <span class="all">{{ allNum ? allNum : roomData.length }}间</span>
               <span class="all">{{ allNum ? allNum : roomData.length }}间</span>
             </div>
             </div>
             <div style="margin: 15px 0"></div>
             <div style="margin: 15px 0"></div>
@@ -269,15 +317,26 @@
               v-model="checkedCities"
               v-model="checkedCities"
               @change="handleCheckedCitiesChange"
               @change="handleCheckedCitiesChange"
             >
             >
-              <el-checkbox size="mini" v-for="(city, ind) in cities" :label="city" :key="city">
+              <el-checkbox
+                size="mini"
+                v-for="(city, ind) in cities"
+                :label="city"
+                :key="city"
+              >
                 {{ city }}
                 {{ city }}
-                <span>{{ citiesNumber[ind] ? citiesNumber[ind] : citiesNum[ind] }}间</span>
+                <span
+                  >{{
+                    citiesNumber[ind] ? citiesNumber[ind] : citiesNum[ind]
+                  }}间</span
+                >
               </el-checkbox>
               </el-checkbox>
             </el-checkbox-group>
             </el-checkbox-group>
           </div>
           </div>
         </div>
         </div>
         <div class="reset">
         <div class="reset">
-          <el-button @click="reset" type="primary" size="mini">重置筛选</el-button>
+          <el-button @click="reset" type="primary" size="mini"
+            >重置筛选</el-button
+          >
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
@@ -1084,6 +1143,7 @@ export default {
     // IC卡页面
     // IC卡页面
     ICpage(roomNo) {
     ICpage(roomNo) {
       // console.log(roomNo);
       // console.log(roomNo);
+      sessionStorage.setItem("roomNo", JSON.stringify(roomNo));
       this.$router.push({
       this.$router.push({
         name: "icCard",
         name: "icCard",
         params: {
         params: {
@@ -1092,7 +1152,8 @@ export default {
       });
       });
     },
     },
     // 指纹页面
     // 指纹页面
-    fingerprintPage() {
+    fingerprintPage(roomNo) {
+      sessionStorage.setItem("roomNo", JSON.stringify(roomNo));
       this.$router.push({
       this.$router.push({
         name: "fingerprint",
         name: "fingerprint",
         params: {
         params: {
@@ -1229,8 +1290,8 @@ export default {
       // 根据房间id查询(拿到电表码,水表码)
       // 根据房间id查询(拿到电表码,水表码)
       this.API.roomThirdSetting.settingId(item.roomId).then(res => {
       this.API.roomThirdSetting.settingId(item.roomId).then(res => {
         console.log(res.data);
         console.log(res.data);
-        this.doorLockList.id = item.id;
-        this.doorLockList.roomId = item.roomId;
+        this.doorLockList.id = res.data.id;
+        this.doorLockList.roomId = res.data.roomId;
         this.doorLockList.electricityId = res.data.electricId;
         this.doorLockList.electricityId = res.data.electricId;
         this.doorLockList.waterId = res.data.waterId;
         this.doorLockList.waterId = res.data.waterId;
         this.doorLockList.doorId = res.data.lockId;
         this.doorLockList.doorId = res.data.lockId;
@@ -1280,7 +1341,7 @@ export default {
       console.log(this.doorLockList);
       console.log(this.doorLockList);
       let arr = {
       let arr = {
         id: this.doorLockList.id,
         id: this.doorLockList.id,
-        roomId: this.doorLockList.roomId,
+        roomId: item.roomId,
         waterId: this.doorLockList.waterId,
         waterId: this.doorLockList.waterId,
         electricId: this.doorLockList.electricityId,
         electricId: this.doorLockList.electricityId,
         lockId: this.doorLockList.doorId
         lockId: this.doorLockList.doorId
@@ -1987,4 +2048,4 @@ export default {
     background-color: #296de3;
     background-color: #296de3;
   }
   }
 }
 }
-</style>
+</style>

+ 227 - 79
admin/src/views/icCard/index.vue

@@ -4,7 +4,9 @@
       <!-- 标题区域 -->
       <!-- 标题区域 -->
       <div slot="header" class="clearfix">
       <div slot="header" class="clearfix">
         <el-breadcrumb separator-class="el-icon-arrow-right">
         <el-breadcrumb separator-class="el-icon-arrow-right">
-          <el-breadcrumb-item :to="{ path: '/home' }">房态管理</el-breadcrumb-item>
+          <el-breadcrumb-item :to="{ path: '/home' }"
+            >房态管理</el-breadcrumb-item
+          >
           <el-breadcrumb-item>IC卡管理</el-breadcrumb-item>
           <el-breadcrumb-item>IC卡管理</el-breadcrumb-item>
         </el-breadcrumb>
         </el-breadcrumb>
       </div>
       </div>
@@ -49,7 +51,12 @@
             >
             >
               <i slot="prefix" class="el-input__icon el-icon-search"></i>
               <i slot="prefix" class="el-input__icon el-icon-search"></i>
             </el-input>-->
             </el-input>-->
-            <el-select v-model="queryUserType" clearable placeholder="请选择类型" @change="getData(1)">
+            <el-select
+              v-model="queryUserType"
+              clearable
+              placeholder="请选择类型"
+              @change="getData(1)"
+            >
               <el-option label="普通用户" value="1"></el-option>
               <el-option label="普通用户" value="1"></el-option>
               <el-option label="管理员" value="0"></el-option>
               <el-option label="管理员" value="0"></el-option>
             </el-select>
             </el-select>
@@ -87,12 +94,18 @@
                 <el-form :model="icCardInfo" label-position="top">
                 <el-form :model="icCardInfo" label-position="top">
                   <div class="left">
                   <div class="left">
                     <el-form-item label="卡类型">
                     <el-form-item label="卡类型">
-                      <el-select v-model="icCardInfo.cardType" placeholder="请选择卡类型">
+                      <el-select
+                        v-model="icCardInfo.cardType"
+                        placeholder="请选择卡类型"
+                      >
                         <el-option label="IC卡" value="IC卡"></el-option>
                         <el-option label="IC卡" value="IC卡"></el-option>
                       </el-select>
                       </el-select>
                     </el-form-item>
                     </el-form-item>
                     <el-form-item label="状态">
                     <el-form-item label="状态">
-                      <el-select v-model="icCardInfo.statu" placeholder="请选择状态">
+                      <el-select
+                        v-model="icCardInfo.statu"
+                        placeholder="请选择状态"
+                      >
                         <el-option label="生效" value="1"></el-option>
                         <el-option label="生效" value="1"></el-option>
                         <el-option label="失效" value="0"></el-option>
                         <el-option label="失效" value="0"></el-option>
                       </el-select>
                       </el-select>
@@ -112,7 +125,7 @@
                   </div>
                   </div>
                   <div class="right">
                   <div class="right">
                     <el-form-item label="卡号">
                     <el-form-item label="卡号">
-                      <el-input v-model="icCardInfo.cardId"></el-input>
+                      <el-input v-model="icCardInfo.cardNumber"></el-input>
                       <span
                       <span
                         style="
                         style="
                           position: absolute;
                           position: absolute;
@@ -120,7 +133,22 @@
                           color: #296de3;
                           color: #296de3;
                           cursor: pointer;
                           cursor: pointer;
                         "
                         "
-                      >读卡</span>
+                        @click="icCardS"
+                        >读卡</span
+                      >
+                      <el-dialog
+                        :visible.sync="icCardShow"
+                        :append-to-body="true"
+                        custom-class="fingerprint"
+                      >
+                        <div class="elbodys">
+                          <span class="title">读取卡号</span>
+                          <i class="el-icon-close" @click="icCardClose"></i>
+                        </div>
+                        <div class="el-footer">
+                          {{ icTitle }}:{{ icCardInfo.cardNumber }}
+                        </div>
+                      </el-dialog>
                     </el-form-item>
                     </el-form-item>
 
 
                     <el-form-item label="姓名">
                     <el-form-item label="姓名">
@@ -133,7 +161,8 @@
                           cursor: pointer;
                           cursor: pointer;
                         "
                         "
                         @click="Editstaff"
                         @click="Editstaff"
-                      >员工</span>
+                        >员工</span
+                      >
                       <el-dialog
                       <el-dialog
                         title="添加员工"
                         title="添加员工"
                         :visible.sync="selectStaffShow"
                         :visible.sync="selectStaffShow"
@@ -163,18 +192,27 @@
                           <ul class="infinite-list" style="overflow: auto">
                           <ul class="infinite-list" style="overflow: auto">
                             <li class="infinite-list-item" v-show="title">
                             <li class="infinite-list-item" v-show="title">
                               <span style="margin-left: 19px">{{ title }}</span>
                               <span style="margin-left: 19px">{{ title }}</span>
-                              <i class="el-icon-close" @click="cancelCheck"></i>
+                              <!-- <i class="el-icon-close" @click="cancelCheck"></i> -->
                             </li>
                             </li>
                           </ul>
                           </ul>
                         </div>
                         </div>
                         <span slot="footer" class="dialog-footer">
                         <span slot="footer" class="dialog-footer">
-                          <el-button @click="selectStaffShow = false">取 消</el-button>
-                          <el-button type="primary" @click="selectStaffShow = false">确 定</el-button>
+                          <el-button @click="selectStaffShow = false"
+                            >取 消</el-button
+                          >
+                          <el-button
+                            type="primary"
+                            @click="selectStaffShow = false"
+                            >确 定</el-button
+                          >
                         </span>
                         </span>
                       </el-dialog>
                       </el-dialog>
                     </el-form-item>
                     </el-form-item>
                     <el-form-item label="用户类型">
                     <el-form-item label="用户类型">
-                      <el-select v-model="icCardInfo.userType " placeholder="用户">
+                      <el-select
+                        v-model="icCardInfo.userType"
+                        placeholder="用户"
+                      >
                         <el-option label="普通用户" value="1"></el-option>
                         <el-option label="普通用户" value="1"></el-option>
                         <el-option label="管理员" value="0"></el-option>
                         <el-option label="管理员" value="0"></el-option>
                       </el-select>
                       </el-select>
@@ -189,7 +227,11 @@
                         @change="endT"
                         @change="endT"
                       ></el-date-picker>
                       ></el-date-picker>
                     </el-form-item>
                     </el-form-item>
-                    <el-radio-group v-model="radio" v-show="selectTime" @change="radioChange">
+                    <el-radio-group
+                      v-model="radio"
+                      v-show="selectTime"
+                      @change="radioChange"
+                    >
                       <el-radio label="一个星期">一个星期</el-radio>
                       <el-radio label="一个星期">一个星期</el-radio>
                       <el-radio label="一个月">一个月</el-radio>
                       <el-radio label="一个月">一个月</el-radio>
                       <el-radio label="半年">半年</el-radio>
                       <el-radio label="半年">半年</el-radio>
@@ -218,7 +260,7 @@
             :cell-style="rowbg"
             :cell-style="rowbg"
             :header-cell-style="{
             :header-cell-style="{
               color: ' rgba(0, 0, 0, 1)',
               color: ' rgba(0, 0, 0, 1)',
-              background: 'rgba(240, 243, 247, 1)',
+              background: 'rgba(240, 243, 247, 1)'
             }"
             }"
           >
           >
             <!-- <el-table-column type="selection" width="60" align="center"></el-table-column> -->
             <!-- <el-table-column type="selection" width="60" align="center"></el-table-column> -->
@@ -240,17 +282,40 @@
               <!-- <template slot-scope="{ row }">{{ options[row.order.orderStatu].label }}</template> -->
               <!-- <template slot-scope="{ row }">{{ options[row.order.orderStatu].label }}</template> -->
             </el-table-column>
             </el-table-column>
 
 
-            <el-table-column prop="takeTime" align="center" width="200" label="生效时间"></el-table-column>
-            <el-table-column prop="failureTime" align="center" width="200" label="失效时间"></el-table-column>
-            <el-table-column prop="holderName" align="center" label="持卡人姓名"></el-table-column>
-            <el-table-column prop="createTime" align="center" width="200" label="创建时间"></el-table-column>
+            <el-table-column
+              prop="takeTime"
+              align="center"
+              width="200"
+              label="生效时间"
+            ></el-table-column>
+            <el-table-column
+              prop="failureTime"
+              align="center"
+              width="200"
+              label="失效时间"
+            ></el-table-column>
+            <el-table-column
+              prop="holderName"
+              align="center"
+              label="持卡人姓名"
+            ></el-table-column>
+            <el-table-column
+              prop="createTime"
+              align="center"
+              width="200"
+              label="创建时间"
+            ></el-table-column>
             <el-table-column align="center" label="用户类型">
             <el-table-column align="center" label="用户类型">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                <span>{{ scope.row.userType==1?'普通用户':'管理员' }}</span>
+                <span>{{
+                  scope.row.userType == 1 ? "普通用户" : "管理员"
+                }}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column prop="statu" align="center" label="状态">
             <el-table-column prop="statu" align="center" label="状态">
-              <template slot-scope="{ row }">{{ row.statu==0?"失效":"生效"}}</template>
+              <template slot-scope="{ row }">{{
+                row.statu == 0 ? "失效" : "生效"
+              }}</template>
             </el-table-column>
             </el-table-column>
             <el-table-column prop="address" align="center" label="操作">
             <el-table-column prop="address" align="center" label="操作">
               <template slot-scope="{ row }">
               <template slot-scope="{ row }">
@@ -321,60 +386,33 @@ export default {
       },
       },
       title: "",
       title: "",
       data: [
       data: [
-        {
-          id: 1,
-          label: "清洁部",
-          disabled: true,
-          children: [
-            {
-              id: 4,
-              label: "张三"
-            },
-            {
-              id: 5,
-              label: "张三"
-            },
-            {
-              id: 6,
-              label: "张三"
-            },
-            {
-              id: 7,
-              label: "张三"
-            }
-          ]
-        },
-        {
-          id: 2,
-          label: "修理部",
-          disabled: true,
-          children: [
-            {
-              id: 8,
-              label: "李四"
-            },
-            {
-              id: 9,
-              label: "李四"
-            }
-          ]
-        },
-        {
-          id: 3,
-          label: "管理部",
-          disabled: true,
-          children: [
-            {
-              id: 10,
-              label: "王五"
-            },
-            {
-              id: 11,
-              label: "王五"
-            }
-          ]
-        }
-      ],
+        // {
+        //   id: 1,
+        //   label: "清洁部",
+        //   disabled: true,
+        //   children: [
+        //     {
+        //       id: 4,
+        //       label: "张三"
+        //     },
+        //     {
+        //       id: 5,
+        //       label: "张三"
+        //     },
+        //     {
+        //       id: 6,
+        //       label: "张三"
+        //     },
+        //     {
+        //       id: 7,
+        //       label: "张三"
+        //     }
+        //   ]
+        // }
+      ], // 员工列表
+
+      icCardShow: false, // 读取卡号页面弹窗
+      icTitle: "请放置卡片", // 卡片读取状态
 
 
       // 筛选查询卡号绑定数据
       // 筛选查询卡号绑定数据
       queryValue: "",
       queryValue: "",
@@ -405,7 +443,37 @@ export default {
     }
     }
   },
   },
   mounted() {
   mounted() {
-    this.roomNo = this.$route.params.roomNo;
+    this.roomNo = JSON.parse(sessionStorage.getItem("roomNo"));
+    this.API.hotelStaff
+      .departList()
+      .then(res => {
+        console.log(res, "员工类型");
+
+        let data = [];
+        res.data.forEach(item => {
+          let children = [];
+          item.staffs.forEach(i => {
+            children.push({
+              label: i.username,
+              id: i.id
+            });
+          });
+          let arr = {
+            id: item.id,
+            label: item.department,
+            disabled: true,
+            children
+          };
+
+          data.push(arr);
+        });
+
+        this.data = data;
+        console.log(data);
+      })
+      .catch(err => {
+        console.log(err);
+      });
     this.getData();
     this.getData();
   },
   },
   methods: {
   methods: {
@@ -448,7 +516,8 @@ export default {
           roomNo: row.roomNo,
           roomNo: row.roomNo,
           cardId: row.cardNumber,
           cardId: row.cardNumber,
           name: row.holderName,
           name: row.holderName,
-          statu: row.statu
+          statu: row.statu,
+          cardNumber: row.cardNumber
         };
         };
         this.startTime = row.takeTime;
         this.startTime = row.takeTime;
         this.endTime = row.failureTime;
         this.endTime = row.failureTime;
@@ -464,7 +533,8 @@ export default {
           cardId: "",
           cardId: "",
           name: "",
           name: "",
           radio: "一个星期",
           radio: "一个星期",
-          statu: "1"
+          statu: "1",
+          cardNumber: ""
         };
         };
         this.startTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
         this.startTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
         this.endTime = dayjs(new Date())
         this.endTime = dayjs(new Date())
@@ -478,8 +548,9 @@ export default {
         console.log("编辑");
         console.log("编辑");
         let params = {
         let params = {
           id: this.icCardInfo.id,
           id: this.icCardInfo.id,
-          cardNumber: this.icCardInfo.cardId,
+          cardNumber: this.icCardInfo.cardNumber,
           roomNo: this.icCardInfo.roomNo,
           roomNo: this.icCardInfo.roomNo,
+
           holderName: this.icCardInfo.name,
           holderName: this.icCardInfo.name,
           userType: this.icCardInfo.userType,
           userType: this.icCardInfo.userType,
           takeTime: this.startTime,
           takeTime: this.startTime,
@@ -500,7 +571,7 @@ export default {
       } else if (this.nameValue == "新增") {
       } else if (this.nameValue == "新增") {
         console.log("新增");
         console.log("新增");
         let params = {
         let params = {
-          cardNumber: this.icCardInfo.cardId,
+          cardNumber: this.icCardInfo.cardNumber,
           roomNo: this.icCardInfo.roomNo,
           roomNo: this.icCardInfo.roomNo,
           holderName: this.icCardInfo.name,
           holderName: this.icCardInfo.name,
           userType: this.icCardInfo.userType,
           userType: this.icCardInfo.userType,
@@ -560,7 +631,45 @@ export default {
       }
       }
       // console.log(this.startTime, this.endTime);
       // console.log(this.startTime, this.endTime);
     },
     },
+    //  读取卡号弹窗
+    icCardS() {
+      this.icCardShow = true;
+      let _this = this;
+      _this.icCardInfo.cardNumber = "";
+      var wsUrl = "ws://localhost:8181/";
+      let websocket = new WebSocket(wsUrl);
+      websocket.onopen = function(evt) {
+        var params = { type: 104, data: null };
+        websocket.send(JSON.stringify(params));
+      };
 
 
+      websocket.onmessage = function(evt) {
+        let data = JSON.parse(evt.data);
+        console.log(data);
+        if (data.type == 150) {
+          // _this.$message.error("未放置卡片")
+          _this.icTitle = "未放置卡片,请重新读卡";
+          setTimeout(() => {
+            _this.icCardShow = false;
+          }, 2000);
+        } else if (data.type == 141) {
+          _this.icTitle = "获取卡号失败";
+          setTimeout(() => {
+            _this.icCardShow = false;
+          }, 2000);
+        } else if (data.type == 140) {
+          _this.icTitle = "获取卡号成功";
+          _this.icCardInfo.cardNumber = data.data.uid;
+          setTimeout(() => {
+            _this.icCardShow = false;
+          }, 2000);
+        }
+      };
+    },
+    // 关闭读取卡号弹窗
+    icCardClose() {
+      this.icCardShow = false;
+    },
     //员工弹窗
     //员工弹窗
     Editstaff() {
     Editstaff() {
       this.selectStaffShow = true;
       this.selectStaffShow = true;
@@ -1118,6 +1227,45 @@ export default {
     }
     }
   }
   }
 }
 }
+/deep/ .fingerprint {
+  width: 800px;
+  height: 600px;
+  .el-dialog__header {
+    display: none;
+  }
+  .el-dialog__body {
+    width: 100%;
+    height: 70px;
+    padding: 0;
+    border-bottom: 1px solid #ccc;
+    .elbodys {
+      width: 100%;
+      height: 70px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      font-size: 18px;
+      color: #000;
+
+      .el-icon-close {
+        cursor: pointer;
+        margin-right: 20px;
+      }
+      .title {
+        margin-left: 20px;
+      }
+      .el-button--primary {
+        background: #296de3;
+      }
+    }
+  }
+  .el-footer {
+    height: 350px;
+    margin: 30px auto;
+    font-size: 40px;
+    font-weight: 800;
+  }
+}
 </style>
 </style>
 <style lang="scss">
 <style lang="scss">
 .el-message-box__wrapper {
 .el-message-box__wrapper {
@@ -1125,4 +1273,4 @@ export default {
     background-color: #296de3;
     background-color: #296de3;
   }
   }
 }
 }
-</style>
+</style>

admin/src/views/inform/index.vue → src/views/inform/index.vue


+ 0 - 21
admin/src/views/login/index.vue

@@ -127,8 +127,6 @@ export default {
                 message: "登录成功",
                 message: "登录成功",
                 type: "success"
                 type: "success"
               });
               });
-              //   this.addrouters();
-              // console.log(this.$router.options.routes);
               this.$router.push({
               this.$router.push({
                 // path: this.redirect || "/home",
                 // path: this.redirect || "/home",
                 path: `${this.$store.state.user.roles[0]}`
                 path: `${this.$store.state.user.roles[0]}`
@@ -146,25 +144,6 @@ export default {
           return false;
           return false;
         }
         }
       });
       });
-    },
-    addrouters() {
-      this.$store.state.user.roles.forEach(item => {
-        // console.log(item);
-        if (item == "home") {
-          router.addRoute("Layout", {
-            path: item,
-            name: item,
-            meta: { isAuth: true, keepAlive: true },
-            component: () => import(`@/views/${item}`)
-          });
-        }
-        router.addRoute("Layout", {
-          path: item,
-          name: item,
-          meta: { isAuth: true },
-          component: () => import(`@/views/${item}`)
-        });
-      });
     }
     }
   }
   }
 };
 };

admin/src/views/order/index.vue → src/views/order/index.vue


+ 44 - 38
admin/src/views/staff/index.vue

@@ -41,17 +41,21 @@
             </div>
             </div>
             <div class="info">
             <div class="info">
               <div class="user">
               <div class="user">
-                <div class="name">职位</div>
-                <el-select v-model="position" placeholder="请选择">
+                <div class="name">部门</div>
+                <el-select v-model="departid" placeholder="请选择">
                   <el-option
                   <el-option
                     v-for="(item, index) in options"
                     v-for="(item, index) in options"
                     :key="index"
                     :key="index"
-                    :label="item.value"
-                    :value="item.value"
+                    :label="item.department"
+                    :value="item.department"
                   >
                   >
                   </el-option>
                   </el-option>
                 </el-select>
                 </el-select>
               </div>
               </div>
+              <div class="user">
+                <div class="name">职位</div>
+                <el-input v-model="position"></el-input>
+              </div>
             </div>
             </div>
             <span slot="footer" class="dialog-footer">
             <span slot="footer" class="dialog-footer">
               <el-button @click.stop="addStaffShow = false" class="cancel"
               <el-button @click.stop="addStaffShow = false" class="cancel"
@@ -72,7 +76,7 @@
             :cell-style="rowbg"
             :cell-style="rowbg"
             :header-cell-style="{
             :header-cell-style="{
               color: ' rgba(0, 0, 0, 1)',
               color: ' rgba(0, 0, 0, 1)',
-              background: 'rgba(240, 243, 247, 1)',
+              background: 'rgba(240, 243, 247, 1)'
             }"
             }"
           >
           >
             <el-table-column prop="username" align="center" label="员工姓名">
             <el-table-column prop="username" align="center" label="员工姓名">
@@ -85,7 +89,8 @@
               align="center"
               align="center"
             >
             >
             </el-table-column>
             </el-table-column>
-
+            <el-table-column prop="departid" align="center" label="部门">
+            </el-table-column>
             <el-table-column prop="position" align="center" label="职位">
             <el-table-column prop="position" align="center" label="职位">
             </el-table-column>
             </el-table-column>
             <el-table-column prop="address" align="center" label="操作">
             <el-table-column prop="address" align="center" label="操作">
@@ -113,17 +118,21 @@
                   </div>
                   </div>
                   <div class="info">
                   <div class="info">
                     <div class="user">
                     <div class="user">
-                      <div class="name">职位</div>
-                      <el-select v-model="position" placeholder="请选择">
+                      <div class="name">部门</div>
+                      <el-select v-model="departid" placeholder="请选择">
                         <el-option
                         <el-option
                           v-for="(item, index) in options"
                           v-for="(item, index) in options"
                           :key="index"
                           :key="index"
-                          :label="item.value"
-                          :value="item.value"
+                          :label="item.department"
+                          :value="item.department"
                         >
                         >
                         </el-option>
                         </el-option>
                       </el-select>
                       </el-select>
                     </div>
                     </div>
+                    <div class="user">
+                      <div class="name">职位</div>
+                      <el-input v-model="position"></el-input>
+                    </div>
                   </div>
                   </div>
                   <span slot="footer" class="dialog-footer">
                   <span slot="footer" class="dialog-footer">
                     <el-button @click.stop="editShow = false" class="cancel"
                     <el-button @click.stop="editShow = false" class="cancel"
@@ -167,29 +176,15 @@ export default {
       // 当前页显示的数据
       // 当前页显示的数据
       tableData: [],
       tableData: [],
       // 职位类型列表
       // 职位类型列表
-      options: [
-        {
-          value: "清洁工",
-        },
-        {
-          value: "维修工",
-        },
-        {
-          value: "财务总监",
-        },
-        {
-          value: "服务员",
-        },
-        {
-          value: "前台",
-        },
-      ],
+      options: [],
       // 搜索框绑定数据
       // 搜索框绑定数据
       value: "",
       value: "",
       // 员工姓名
       // 员工姓名
       staffValue: "",
       staffValue: "",
       // 员工手机号码
       // 员工手机号码
       phoneValue: "",
       phoneValue: "",
+      // 员工部门
+      departid: "",
       // 员工职位
       // 员工职位
       position: "",
       position: "",
       // 添加员工弹窗控制
       // 添加员工弹窗控制
@@ -203,11 +198,20 @@ export default {
       // 每页条数
       // 每页条数
       pageSize: 8,
       pageSize: 8,
       // 修改数据的id
       // 修改数据的id
-      id: "",
+      id: ""
     };
     };
   },
   },
   mounted() {
   mounted() {
     this.getData();
     this.getData();
+    this.API.hotelStaff
+      .departList()
+      .then(res => {
+        console.log(res, "员工类型");
+        this.options = res.data;
+      })
+      .catch(err => {
+        console.log(err);
+      });
   },
   },
   methods: {
   methods: {
     // 获取员工管理页面表格数据
     // 获取员工管理页面表格数据
@@ -218,7 +222,7 @@ export default {
       let params = {
       let params = {
         curPage: this.curPage,
         curPage: this.curPage,
         pageSize: this.pageSize,
         pageSize: this.pageSize,
-        keyword: this.value,
+        keyword: this.value
       };
       };
       let res = await this.API.hotelStaff.hotelStaffList(params);
       let res = await this.API.hotelStaff.hotelStaffList(params);
       // console.log(res);
       // console.log(res);
@@ -235,7 +239,7 @@ export default {
       this.$confirm("确定删除吗?", "提示", {
       this.$confirm("确定删除吗?", "提示", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
       })
         .then(async () => {
         .then(async () => {
           let res = await this.API.hotelStaff.hotelStaffDelete([row.id]);
           let res = await this.API.hotelStaff.hotelStaffDelete([row.id]);
@@ -262,12 +266,12 @@ export default {
       this.phoneValue = "";
       this.phoneValue = "";
       this.staffValue = "";
       this.staffValue = "";
       this.position = "";
       this.position = "";
+      this.departid = "";
     },
     },
 
 
     // 添加员工弹窗完成按钮回调
     // 添加员工弹窗完成按钮回调
     async addSuccess() {
     async addSuccess() {
-      let reg_tel =
-        /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
+      let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
       if (reg_tel.test(this.phoneValue)) {
       if (reg_tel.test(this.phoneValue)) {
         if (this.staffValue.trim() == "") {
         if (this.staffValue.trim() == "") {
           this.$message({ message: "输入的姓名不能为空", type: "error" });
           this.$message({ message: "输入的姓名不能为空", type: "error" });
@@ -278,8 +282,9 @@ export default {
             phone: this.phoneValue,
             phone: this.phoneValue,
             username: this.staffValue,
             username: this.staffValue,
             position: this.position,
             position: this.position,
+            departid: this.departid,
             cardNumber: 666,
             cardNumber: 666,
-            statu: 1,
+            statu: 1
           };
           };
           let res = await this.API.hotelStaff.hotelStaffSave(params);
           let res = await this.API.hotelStaff.hotelStaffSave(params);
           // console.log(res);
           // console.log(res);
@@ -304,12 +309,12 @@ export default {
       this.phoneValue = row.phone;
       this.phoneValue = row.phone;
       this.staffValue = row.username;
       this.staffValue = row.username;
       this.position = row.position;
       this.position = row.position;
+      this.departid = row.departid;
     },
     },
 
 
     // 编辑员工弹窗完成按钮回调
     // 编辑员工弹窗完成按钮回调
     async editSuccess() {
     async editSuccess() {
-      let reg_tel =
-        /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
+      let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
       if (reg_tel.test(this.phoneValue)) {
       if (reg_tel.test(this.phoneValue)) {
         if (this.staffValue.trim() == "") {
         if (this.staffValue.trim() == "") {
           this.$message({ message: "输入的姓名不能为空", type: "error" });
           this.$message({ message: "输入的姓名不能为空", type: "error" });
@@ -321,8 +326,9 @@ export default {
             phone: this.phoneValue,
             phone: this.phoneValue,
             username: this.staffValue,
             username: this.staffValue,
             position: this.position,
             position: this.position,
+            departid: this.departid,
             cardNumber: 666,
             cardNumber: 666,
-            statu: 1,
+            statu: 1
           };
           };
           let res = await this.API.hotelStaff.hotelStaffUpdate(data);
           let res = await this.API.hotelStaff.hotelStaffUpdate(data);
           // console.log(res);
           // console.log(res);
@@ -350,8 +356,8 @@ export default {
       if (row.rowIndex % 2 != 0) {
       if (row.rowIndex % 2 != 0) {
         return { background: "rgba(240, 243, 247, 1)", "border-radius": "5px" };
         return { background: "rgba(240, 243, 247, 1)", "border-radius": "5px" };
       }
       }
-    },
-  },
+    }
+  }
 };
 };
 </script>
 </script>
 
 

admin/src/views/stat/index.vue → src/views/stat/index.vue


admin/src/views/system/index.vue → src/views/system/index.vue


admin/static/.gitkeep → static/.gitkeep


admin/test/e2e/custom-assertions/elementCount.js → test/e2e/custom-assertions/elementCount.js


+ 0 - 0
admin/test/e2e/nightwatch.conf.js


Some files were not shown because too many files changed in this diff