浏览代码

完成指纹和ic卡页面

hzj18279462576@163.com 3 年之前
父节点
当前提交
c68091f840
共有 9 个文件被更改,包括 601 次插入617 次删除
  1. 3 3
      index.html
  2. 7 7
      src/api/fingerprint.js
  3. 11 11
      src/api/roomRealTimeStatu.js
  4. 91 95
      src/router/index.js
  5. 195 196
      src/store/modules/user.js
  6. 214 219
      src/views/fingerprint/index.vue
  7. 51 51
      src/views/home/index.vue
  8. 28 34
      src/views/icCard/index.vue
  9. 1 1
      src/views/staff/index.vue

+ 3 - 3
index.html

@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <title>admin</title>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
+    <title>智慧校园公寓管理</title>
   </head>
   <body>
     <div id="app"></div>

+ 7 - 7
src/api/fingerprint.js

@@ -15,17 +15,17 @@ export function queryICInfoById(params) {
 export function add(params) {
   return http.post(`${resquest}/add`, params);
 }
-//  指纹修改
+//  指纹修改  hotel/ihotel-api/ihotel/condition/fingerprint/update
 export function update(params) {
-  return http.post(`${resquest}/ic/update`, params);
+  return http.post(`${resquest}/update`, params);
 }
 
-// 指纹解绑
+// 指纹解绑  hotel/ihotel-api/ihotel/condition/fingerprint/unbundFingerprint
 export function unbundIC(params) {
-  return http.get(`${resquest}/ic/unbundIC`, params);
+  return http.get(`${resquest}/unbundFingerprint`, params);
 }
 
 // 指纹导出详情
-export function downLoadICInfo(params) {
-  return http.get(`${resquest}/downLoadICInfo`, params, "", "blob");
-}
+// export function downLoadICInfo(params) {
+//   return http.get(`${resquest}/downLoadICInfo`, params, "", "blob");
+// }

+ 11 - 11
src/api/roomRealTimeStatu.js

@@ -1,25 +1,25 @@
-import http from '../utils/http'
-let resquest = "/hotel/ihotel-api/ihotel/roomRealTimeStatu"
+import http from "../utils/http";
+let resquest = "/hotel/ihotel-api/ihotel/roomRealTimeStatu";
 
 //  房态信息
 export function realData(params) {
-    return http.get(`${resquest}/realData/${params}`)
+  return http.get(`${resquest}/realData/${params}`);
 }
 
-// 脏房修改为空闲房间
+// 脏房修改为空闲房间   /hotel/ihotel-api/ihotel/roomRealTimeStatu/clean/cleanByStatuId
 let ContentType = {
-    'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
-}
+  "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
+};
 export function clean(params) {
-    return http.post(`${resquest}/clean/cleanByStatuId`, params)
+  return http.post(`${resquest}/clean/cleanByStatuId`, params);
 }
 
-// 锁定房间
+// 锁定房间  /hotel/ihotel-api/ihotel/roomRealTimeStatu/lock
 export function lock(params) {
-    return http.put(`${resquest}/lock`, params)
+  return http.put(`${resquest}/lock`, params);
 }
 
 // 房间转为脏房
 export function toDirty(params) {
-    return http.put(`${resquest}/toDirty`, params)
-}
+  return http.put(`${resquest}/toDirty`, params);
+}

+ 91 - 95
src/router/index.js

@@ -1,106 +1,102 @@
-import Vue from 'vue'
+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)
-//不管是超级管理员还是普通用户都可以看到的页面 
+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
-    // }
-
-]
+  // 登录页
+  {
+    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
-})
+  // mode: 'history', // require service support
+  scrollBehavior: () => ({ y: 0 }),
+  routes: constantRoutes
+});
 
-export default router
+export default router;
 router.beforeEach((to, from, next) => {
-    //判断 如果cook是否存在,可以进去
-    if (Cookies.get('cook') == store.state.user.token) {
-        console.log(1111)
-        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 {
-
-        if (to.path === '/') {
-            console.log(3333);
-            next({ path: '/login' })
+      // 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 {
-            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()
-                }
-
-            }
+          next();
         }
+      }
     }
-
-
-})
-
-
+  }
+});
 
 //全局前置路由守卫————初始化的时候被调用、每次路由切换之前被调用
 // router.beforeEach((to, from, next) => {
@@ -153,4 +149,4 @@ router.beforeEach((to, from, next) => {
 //         // next()
 
 //     }
-// })
+// })

+ 195 - 196
src/store/modules/user.js

@@ -1,207 +1,206 @@
-import { login, logout, getInfo } from '@/api/acl/user'
-import { getToken, setToken, removeToken } from '@/utils/auth'
-import { resetRouter } from '@/router'
+import { login, logout, getInfo } from "@/api/acl/user";
+import { getToken, setToken, removeToken } from "@/utils/auth";
+import { resetRouter } from "@/router";
 import router from "@/router";
-import api from '@/api/api'
-import Layout from '@/layout'
+import api from "@/api/api";
+import Layout from "@/layout";
 const getDefaultState = () => {
-    return {
-        token: '',
-        userName: '',
-        headImage: '',
-        userType: '',
-        telPhone: '',
-        time: new Date(),
-        avatar: '',
-        roles: [],
-        statRoutes:
-            [{
-                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: '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')
-                    }
-                ]
-            }]
-        ,
-        buttons: []
-    }
-}
-
-const state = getDefaultState()
+  return {
+    token: "",
+    userName: "",
+    headImage: "",
+    userType: "",
+    telPhone: "",
+    time: new Date(),
+    avatar: "",
+    roles: [],
+    statRoutes: [
+      {
+        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: "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")
+          }
+        ]
+      }
+    ],
+    buttons: []
+  };
+};
+
+const state = getDefaultState();
 
 const mutations = {
-    RESET_STATE: (state) => {
-        Object.assign(state, getDefaultState())
-    },
-    SET_TOKEN: (state, token) => {
-        state.token = token
-    },
-
-    SET_USERINFO: (state, userInfo) => {
-        state.userName = userInfo.userName
-        state.headImage = userInfo.headImage
-        state.userType = userInfo.userType
-        state.telPhone = userInfo.telPhone
-    },
-
-    SET_ROLES: (state, roles) => {
-        if (typeof roles === 'string') {
-            state.roles = roles.split('/')
-            // console.log('roles是字符串');
-        } else {
-            state.roles = roles
-        }
-        state.roles.forEach(item => {
-            if (item == "home") {
-                state.statRoutes[0].children.push({
-                    path: item,
-                    name: item,
-                    meta: { isAuth: true, keepAlive: true },
-                    component: () => import(`@/views/${item}`)
-                });
-            } else {
-                state.statRoutes[0].children.push({
-                    path: item,
-                    name: item,
-                    meta: { isAuth: true },
-                    component: () => import(`@/views/${item}`)
-                });
-            }
-            // router.addRoute([...state.statRoutes])
-            if (item == "home") {
-                router.addRoute("Layout", {
-                    path: item,
-                    name: item,
-                    meta: { isAuth: true, keepAlive: true },
-                    component: () => import(`@/views/${item}`)
-                });
-            } else {
-                router.addRoute("Layout", {
-                    path: item,
-                    name: item,
-                    meta: { isAuth: true },
-                    component: () => import(`@/views/${item}`)
-                });
-            }
-        });
-
-    },
-    SET_TIME: (state, time) => {
-        state.time = time
+  RESET_STATE: state => {
+    Object.assign(state, getDefaultState());
+  },
+  SET_TOKEN: (state, token) => {
+    state.token = token;
+  },
+
+  SET_USERINFO: (state, userInfo) => {
+    state.userName = userInfo.userName;
+    state.headImage = userInfo.headImage;
+    state.userType = userInfo.userType;
+    state.telPhone = userInfo.telPhone;
+  },
+
+  SET_ROLES: (state, roles) => {
+    if (typeof roles === "string") {
+      state.roles = roles.split("/");
+      // console.log('roles是字符串');
+    } else {
+      state.roles = roles;
     }
-}
+    state.roles.forEach(item => {
+      if (item == "home") {
+        state.statRoutes[0].children.push({
+          path: item,
+          name: item,
+          meta: { isAuth: true, keepAlive: true },
+          component: () => import(`@/views/${item}`)
+        });
+      } else {
+        state.statRoutes[0].children.push({
+          path: item,
+          name: item,
+          meta: { isAuth: true },
+          component: () => import(`@/views/${item}`)
+        });
+      }
+      // router.addRoute([...state.statRoutes])
+      if (item == "home") {
+        router.addRoute("Layout", {
+          path: item,
+          name: item,
+          meta: { isAuth: true, keepAlive: true },
+          component: () => import(`@/views/${item}`)
+        });
+      } else {
+        router.addRoute("Layout", {
+          path: item,
+          name: item,
+          meta: { isAuth: true },
+          component: () => import(`@/views/${item}`)
+        });
+      }
+    });
+  },
+  SET_TIME: (state, time) => {
+    state.time = time;
+  }
+};
 
 const actions = {
-    // user login
-    login({ commit }, userInfo) {
-        const { username, password } = userInfo
-        return new Promise((resolve, reject) => {
-            api.hotelAdmin.hotelStaffLogin({ username: username.trim(), password: password })
-                .then((response) => {
-                    console.log(response);
-                    const { data } = response
-                    commit('SET_TOKEN', data.token)
-                    commit('SET_USERINFO', data)
-                    commit('SET_ROLES', data.authority)
-                    setToken('cook', data.token)
-                    setToken('user', username)
-                    setToken('password', password)
-                    console.log("resolve")
-                    resolve()
-                })
-                .catch((error) => {
-                    console.log("error");
-                    reject(error)
-                })
+  // user login
+  login({ commit }, userInfo) {
+    const { username, password } = userInfo;
+    return new Promise((resolve, reject) => {
+      api.hotelAdmin
+        .hotelStaffLogin({ username: username.trim(), password: password })
+        .then(response => {
+          // console.log(response);
+          const { data } = response;
+          commit("SET_TOKEN", data.token);
+          commit("SET_USERINFO", data);
+          commit("SET_ROLES", data.authority);
+          setToken("cook", data.token);
+          setToken("user", username);
+          setToken("password", password);
+          // console.log("resolve")
+          resolve();
         })
-    },
-
-    // get user info
-    getInfo({ commit, state }) {
-        return new Promise((resolve, reject) => {
-            getInfo(state.token)
-                .then((response) => {
-                    const { data } = response
-
-                    if (!data) {
-                        reject('Verification failed, please Login again.')
-                    }
-
-                    const { roles } = data
-
-                    // roles must be a non-empty array
-                    if (!roles || roles.length <= 0) {
-                        reject('getInfo: roles must be a non-null array!')
-                    }
-
-                    commit('SET_ROLES', roles)
-                    commit('SET_USERINFO', data)
-                    resolve(data)
-                })
-                .catch((error) => {
-                    reject(error)
-                })
-        })
-    },
-
-    // user logout
-    logout({ commit, state }) {
-        removeToken('cook') // must remove  token  first
-        // resetRouter()
-        removeToken('user')
-        removeToken('password')
-        commit('RESET_STATE')
-
-    },
-
-    // remove token
-    resetToken({ commit }) {
-        return new Promise((resolve) => {
-            // removeToken() // must remove  token  first
-            commit('RESET_STATE')
-            resolve()
+        .catch(error => {
+          // console.log("error");
+          reject(error);
+        });
+    });
+  },
+
+  // get user info
+  getInfo({ commit, state }) {
+    return new Promise((resolve, reject) => {
+      getInfo(state.token)
+        .then(response => {
+          const { data } = response;
+
+          if (!data) {
+            reject("Verification failed, please Login again.");
+          }
+
+          const { roles } = data;
+
+          // roles must be a non-empty array
+          if (!roles || roles.length <= 0) {
+            reject("getInfo: roles must be a non-null array!");
+          }
+
+          commit("SET_ROLES", roles);
+          commit("SET_USERINFO", data);
+          resolve(data);
         })
-    },
-
-    // set User Routes
-    setUserRoutes({ commit }) {
-        commit('SET_ROLES', data)
-    }
-}
+        .catch(error => {
+          reject(error);
+        });
+    });
+  },
+
+  // user logout
+  logout({ commit, state }) {
+    removeToken("cook"); // must remove  token  first
+    // resetRouter()
+    removeToken("user");
+    removeToken("password");
+    commit("RESET_STATE");
+  },
+
+  // remove token
+  resetToken({ commit }) {
+    return new Promise(resolve => {
+      // removeToken() // must remove  token  first
+      commit("RESET_STATE");
+      resolve();
+    });
+  },
+
+  // set User Routes
+  setUserRoutes({ commit }) {
+    commit("SET_ROLES", data);
+  }
+};
 
 export default {
-    namespaced: true,
-    state,
-    mutations,
-    actions
-}
+  namespaced: true,
+  state,
+  mutations,
+  actions
+};

+ 214 - 219
src/views/fingerprint/index.vue

@@ -68,9 +68,9 @@
               custom-class="addDialog"
             >
               <div class="elbody">
-                <span class="ic">指纹录入</span>
-                <el-button @click="addDialogShow = false">关 闭</el-button>
-                <el-button @click="addDialogShow = false" type="primary"
+                <span class="ic">{{ addTitle }}</span>
+                <el-button @click="closefingerprint">关 闭</el-button>
+                <el-button @click="addfingerprint" type="primary"
                   >保 存</el-button
                 >
               </div>
@@ -98,6 +98,7 @@
                         width="692px"
                         append-to-body
                         custom-class="dialongAllRoom"
+                        :close-on-click-modal="false"
                       >
                         <div class="tree">
                           <div class="tree-left">
@@ -121,11 +122,11 @@
                           </div>
                           <ul class="infinite-list" style="overflow: auto">
                             <li class="infinite-list-item" v-show="title">
-                              <span style="margin-left: 19px">{{ title }}</span
-                              ><i
+                              <span style="margin-left: 19px">{{ title }}</span>
+                              <!-- <i
                                 class="el-icon-close"
                                 @click="cancelCheck"
-                              ></i>
+                              ></i> -->
                             </li>
                           </ul>
                         </div>
@@ -146,15 +147,8 @@
                         v-model="icCardInfo.userType"
                         placeholder="用户"
                       >
-                        <el-option
-                          label="普通用户"
-                          value="普通用户"
-                        ></el-option>
-                        <el-option
-                          label="不普通用户"
-                          value="不普通用户"
-                        ></el-option>
-                        <el-option label="管理员" value="管理员"></el-option>
+                        <el-option label="普通用户" value="2"></el-option>
+                        <el-option label="管理员" value="1"></el-option>
                       </el-select>
                     </el-form-item>
                     <el-form-item label="生效时间(默认今天)">
@@ -167,9 +161,6 @@
                       >
                       </el-date-picker>
                     </el-form-item>
-                    <el-form-item label="房间号(锁设备UID)">
-                      <el-input v-model="icCardInfo.roomId"></el-input>
-                    </el-form-item>
                   </div>
                   <div class="right">
                     <el-form-item label="指纹">
@@ -195,6 +186,7 @@
                         :visible.sync="fingerprintShow"
                         :append-to-body="true"
                         custom-class="fingerprint"
+                        :close-on-click-modal="false"
                       >
                         <div class="elbody">
                           <span>指 纹</span>
@@ -206,13 +198,18 @@
                         <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
+                                v-for="i in step"
+                                :key="i.id"
+                                :title="`步骤 ${i.id}`"
+                                :description="i.title"
+                              ></el-step>
+                              <!-- <el-step title="步骤 2"></el-step>
                               <el-step title="步骤 3"></el-step>
                               <el-step
                                 title="步骤 4"
                                 description="录取成功"
-                              ></el-step>
+                              ></el-step> -->
                             </el-steps>
                           </div>
                         </div>
@@ -244,7 +241,7 @@
               </div>
             </el-dialog>
 
-            <div class="export" @click="exportExcel">导出订单</div>
+            <!-- <div class="export" @click="exportExcel">导出订单</div> -->
           </div>
         </div>
         <!-- 表格区域 -->
@@ -329,147 +326,6 @@
                 <span @click="handleDelete(row)" class="operate">解绑</span>
                 <!-- 编辑按钮 -->
                 <span @click="handleEdit(row)" class="operate">编辑</span>
-
-                <el-dialog
-                  title="指纹录入"
-                  :visible.sync="dialogVisible"
-                  custom-class="editCard"
-                >
-                  <div class="dialog-footer">
-                    <el-form :model="icCardInfo" label-position="top">
-                      <div class="left">
-                        <el-form-item label="卡号">
-                          <el-input v-model="icCardInfo.roomId"></el-input>
-                        </el-form-item>
-                        <el-form-item label="房间号(锁设备UID)">
-                          <el-input v-model="icCardInfo.roomId"></el-input>
-                        </el-form-item>
-                        <el-form-item label="创建时间">
-                          <el-input v-model="icCardInfo.roomId"></el-input>
-                        </el-form-item>
-
-                        <el-form-item label="生效时间(默认今天)">
-                          <el-date-picker
-                            v-model="startTime"
-                            type="datetime"
-                            placeholder="选择日期时间"
-                            default-time="12:00:00"
-                            value-format="yyyy-MM-dd HH:mm:ss"
-                          >
-                          </el-date-picker>
-                        </el-form-item>
-                      </div>
-                      <div class="right">
-                        <el-form-item label="用户类型">
-                          <el-select
-                            v-model="icCardInfo.userType"
-                            placeholder="用户"
-                          >
-                            <el-option
-                              label="普通用户"
-                              value="普通用户"
-                            ></el-option>
-                            <el-option
-                              label="不普通用户"
-                              value="不普通用户"
-                            ></el-option>
-                            <el-option
-                              label="管理员"
-                              value="管理员"
-                            ></el-option>
-                          </el-select>
-                        </el-form-item>
-                        <el-form-item label="持卡人姓名">
-                          <el-input v-model="icCardInfo.name"></el-input>
-                          <span
-                            style="
-                              position: absolute;
-                              left: 200px;
-                              color: #296de3;
-                              cursor: pointer;
-                            "
-                            @click="Editstaff"
-                            >员工</span
-                          >
-                          <el-dialog
-                            title="添加员工"
-                            :visible.sync="selectStaffShow"
-                            width="692px"
-                            append-to-body
-                            custom-class="dialongAllRoom"
-                          >
-                            <div class="tree">
-                              <div class="tree-left">
-                                <span style="margin-left: 15px">列表</span>
-                                <span style="margin-left: 228px">1/1</span>
-                              </div>
-                              <el-tree
-                                :data="data"
-                                show-checkbox
-                                node-key="id"
-                                ref="roomTree"
-                                :default-expand-all="true"
-                                :props="defaultProps"
-                                @check="checkStaff"
-                              >
-                              </el-tree>
-                            </div>
-                            <div class="tree">
-                              <div class="tree-left">
-                                <p style="margin-left: 15px">已选</p>
-                              </div>
-                              <ul class="infinite-list" style="overflow: auto">
-                                <li class="infinite-list-item" v-show="title">
-                                  <span style="margin-left: 19px">{{
-                                    title
-                                  }}</span
-                                  ><i
-                                    class="el-icon-close"
-                                    @click="cancelCheck"
-                                  ></i>
-                                </li>
-                              </ul>
-                            </div>
-                            <span slot="footer" class="dialog-footer">
-                              <el-button @click="selectStaffShow = false"
-                                >取 消</el-button
-                              >
-                              <el-button
-                                type="primary"
-                                @click="selectStaffShow = false"
-                                >确 定</el-button
-                              >
-                            </span>
-                          </el-dialog>
-                        </el-form-item>
-                        <el-form-item label="收预付款(元)">
-                          <el-input v-model="icCardInfo.roomId"></el-input>
-                        </el-form-item>
-                        <el-form-item label="失效时间">
-                          <el-date-picker
-                            v-model="endTime"
-                            type="datetime"
-                            placeholder="选择日期时间"
-                            value-format="yyyy-MM-dd HH:mm:ss"
-                            default-time="12:00:00"
-                            @change="endT"
-                          >
-                          </el-date-picker>
-                        </el-form-item>
-                        <el-radio-group
-                          v-model="icCardInfo.radio"
-                          @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-group>
-                      </div>
-                    </el-form>
-                  </div>
-                </el-dialog>
               </template>
             </el-table-column>
           </el-table>
@@ -507,12 +363,11 @@ export default {
       // 新增 弹窗属性
       addDialogShow: false,
       icCardInfo: {
-        cardType: [],
-        userType: "",
-        roomId: "",
-        cardId: "",
-        name: "",
-        radio: "一个星期"
+        userType: "", // 用户类型
+        cardId: "", // 指纹编码
+        name: "", // 用户姓名
+        radio: "一个星期",
+        id: ""
       },
       startTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
       endTime: dayjs(new Date())
@@ -521,9 +376,16 @@ export default {
       // 指纹录入弹窗属性
       fingerprintShow: false,
       stepindex: 0, // 录取指纹步骤
+      step: [
+        { id: 1, title: "" },
+        { id: 2, title: "" },
+        { id: 3, title: "" },
+        { id: 4, title: "" }
+      ], // 指纹步骤数据
       roomNo: "", // 房间号
 
       // 员工弹窗属性
+      addTitle: "新增指纹",
       selectStaffShow: false,
       defaultProps: {
         children: "children",
@@ -588,12 +450,42 @@ export default {
   },
   watch: {
     stepindex(newVal, oldVal) {
-      console.log(newVal);
+      // console.log(newVal);
       this.stepindex = newVal;
     }
   },
   mounted() {
     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();
   },
   methods: {
@@ -606,9 +498,12 @@ export default {
     // 获取表格数据
     async getData() {
       let params = "";
+      if (this.createTime == null) {
+        this.createTime = "";
+      }
       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, "指纹管理");
+      // console.log(res, "指纹管理");
       if (res.success) {
         this.tableData = res.data.list;
         this.total = res.data.totalCount;
@@ -619,6 +514,69 @@ export default {
     //新增弹窗
     addCard() {
       this.addDialogShow = true;
+      this.selectTime = true;
+      this.addTitle = "新增指纹";
+      this.icCardInfo = {
+        userType: "",
+        cardId: "",
+        name: "",
+        radio: "一个星期",
+        id: ""
+      };
+      this.startTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss");
+      this.endTime = dayjs(new Date())
+        .add(7, "day")
+        .format("YYYY-MM-DD HH:mm:ss");
+    },
+    // 确定新增指纹
+    async addfingerprint() {
+      if (this.addTitle == "新增指纹") {
+        let data = {
+          fingerprintNumber: this.icCardInfo.cardId, //指纹编码
+          roomNo: this.roomNo, //房间号
+          holderName: this.icCardInfo.name, // 持有人
+          userType: this.icCardInfo.userType, // 用户类型
+          takeTime: this.startTime, // 生效时间
+          failureTime: this.endTime, // 失效时间
+          createTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), // 创建时间
+          statu: 1 // 状态 失效:0  生效:1
+        };
+        let res = await this.API.fingerprint.add(data);
+        if (res.code == 1) {
+          this.$message.success("新增成功");
+          this.getData();
+          this.addDialogShow = false;
+        } else {
+          this.$message.error("新增失败");
+        }
+        // console.log(res, "确定添加指纹");
+      } else if (this.addTitle == "编辑指纹") {
+        let data = {
+          id: this.icCardInfo.id, //数据id
+          fingerprintNumber: this.icCardInfo.cardId, //指纹编码
+          roomNo: this.roomNo, //房间号
+          holderName: this.icCardInfo.name, // 持有人
+          userType: this.icCardInfo.userType, // 用户类型
+          takeTime: this.startTime, // 生效时间
+          failureTime: this.endTime, // 失效时间
+          createTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"), // 创建时间
+          statu: 1 // 状态 失效:0  生效:1
+        };
+        let res = await this.API.fingerprint.update(data);
+        if (res.code == 1) {
+          this.$message.success("修改成功");
+          this.getData();
+          this.addDialogShow = false;
+        } else {
+          this.$message.error("修改失败");
+        }
+      }
+
+      // this.addDialogShow = false;
+    },
+    // 关闭新增指纹
+    closefingerprint() {
+      this.addDialogShow = false;
     },
     endT() {
       if (
@@ -662,6 +620,13 @@ export default {
     //指纹录入
     fingerprin() {
       this.fingerprintShow = true;
+      this.step = [
+        { id: 1, title: "" },
+        { id: 2, title: "" },
+        { id: 3, title: "" },
+        { id: 4, title: "" }
+      ];
+      this.stepindex = 0;
       let _this = this;
       var wsUrl = "ws://localhost:8181/";
       let websocket = new WebSocket(wsUrl);
@@ -671,22 +636,21 @@ export default {
       };
 
       websocket.onmessage = function(evt) {
-        console.log(evt.data, "输出数据");
+        // console.log(evt.data, "输出数据");
         let data = JSON.parse(evt.data);
-
         if (data.type == 0) {
-          console.log("检测到设备");
+          // console.log(JSON.parse(evt.data).data.portNames); // 获取到 USB接口
           let params1 = {
             type: 1,
             data: {
               type: 0,
-              portName: "COM3",
+              portName: JSON.parse(evt.data).data.portNames[1],
               baudRate: 115200
             }
           };
           websocket.send(JSON.stringify(params1));
         } else if (data.type == 110) {
-          console.log("已获取设备信息");
+          // console.log("已获取设备信息");
         } else if (data.type == 11) {
           var params2 = {
             type: 2,
@@ -697,9 +661,20 @@ export default {
           websocket.send(JSON.stringify(params2));
         } else if (data.type == 21) {
           if (data.data.step == 0) {
-            console.log("请按压指纹");
+            // console.log("请按压指纹");
+            _this.$message.success("请开始按压指纹");
           } else {
-            console.log(`请按下同一指纹,第${data.data.step}次按压`);
+            // console.log(`请按下同一指纹,第${data.data.step}次按压`);
+            if (data.data.step <= 4) {
+              // _this.$message.success(
+              //   `请按下同一指纹,第${data.data.step}次录入指纹成功`
+              // );
+              _this.step.forEach(item => {
+                if (item.id == data.data.step) {
+                  item.title = `请按下同一指纹,第${data.data.step}次录入指纹成功`;
+                }
+              });
+            }
             _this.stepindex = data.data.step;
           }
           // _this.$message.warning("请将手指按在传感器上");
@@ -715,7 +690,10 @@ export default {
         } else if (data.type == 31) {
           _this.icCardInfo.cardId = data.data.template;
           _this.$message.success("指纹录取成功");
-          _this.fingerprintShow = false;
+          setTimeout(() => {
+            _this.fingerprintShow = false;
+            websocket.close();
+          }, 1500);
         } else {
           _this.$message.error("设备连接失败,请刷新重新录入");
         }
@@ -750,6 +728,7 @@ export default {
       // console.log(this.count);
       this.$refs.roomTree.setCheckedNodes(this.count);
       this.title = this.count[0].label;
+      this.icCardInfo.name = this.count[0].label;
     },
     cancelCheck() {
       //   if (this.data[0].children.length == this.count.length) {
@@ -794,55 +773,70 @@ export default {
       return wbout;
     },
 
-    //详情按钮回调
+    //编辑按钮回调
     handleEdit(row) {
       // console.log(row);
-      this.order = row.order;
-      this.waterTable = [];
-      this.electricTable = [];
-      if (row.orderBill) {
-        let waterTemList = [];
-        let electricTemList = [];
-
-        waterTemList.push({
-          startOfWater: row.orderBill.startOfWater,
-          endOfWater: row.orderBill.endOfWater,
-          priceOfWater: row.orderBill.priceOfWater,
-          waterVolume: row.orderBill.endOfWater - row.orderBill.startOfWater,
-          allowance: null,
-          cost:
-            row.orderBill.priceOfWater *
-            (row.orderBill.endOfWater - row.orderBill.startOfWater)
-        });
-
-        electricTemList.push({
-          startOfElectric: row.orderBill.startOfElectric,
-          endOfElectric: row.orderBill.endOfElectric,
-          priceOfElectric: row.orderBill.priceOfElectric,
-          electricVolume:
-            row.orderBill.endOfElectric - row.orderBill.startOfElectric,
-          allowance: null,
-          cost:
-            row.orderBill.priceOfElectric *
-            (row.orderBill.endOfElectric - row.orderBill.startOfElectric)
-        });
-        this.waterTable = waterTemList;
-        this.electricTable = electricTemList;
+      this.addDialogShow = true;
+      this.selectTime = true;
+      this.addTitle = "编辑指纹";
+      this.icCardInfo = {
+        id: row.id,
+        userType: row.userType,
+        cardId: row.fingerprintNumber,
+        name: row.holderName,
+        radio: ""
+      };
+      this.startTime = row.takeTime;
+      this.endTime = row.failureTime;
+      if (
+        this.endTime ==
+        dayjs(this.startTime)
+          .add(1, "week")
+          .format("YYYY-MM-DD HH:mm:ss")
+      ) {
+        this.icCardInfo.radio = "一个星期";
+      } else if (
+        this.endTime ==
+        dayjs(this.startTime)
+          .add(1, "month")
+          .format("YYYY-MM-DD HH:mm:ss")
+      ) {
+        this.icCardInfo.radio = "一个月";
+      } else if (
+        this.endTime ==
+        dayjs(this.startTime)
+          .add(6, "month")
+          .format("YYYY-MM-DD HH:mm:ss")
+      ) {
+        this.icCardInfo.radio = "半年";
+      } else if (
+        this.endTime ==
+        dayjs(this.startTime)
+          .add(1, "year")
+          .format("YYYY-MM-DD HH:mm:ss")
+      ) {
+        this.icCardInfo.radio = "一年";
+      } else if (
+        (this.endTime = dayjs(this.startTime)
+          .add(100, "year")
+          .format("YYYY-MM-DD HH:mm:ss"))
+      ) {
+        this.icCardInfo.radio = "长期";
       }
-      this.dialogVisible = true;
     },
 
     //删除按钮回调
     handleDelete(row) {
-      // console.log(row.order.id);
-      this.$confirm("确认删除?")
+      // console.log(row.id);
+      this.$confirm("确认解绑?")
         .then(async () => {
-          let res = await this.API.hotelOrder.hotelOrderAdminDelete(
-            row.order.id
-          );
+          let res = await this.API.fingerprint.unbundIC({
+            id: row.id,
+            statu: 0
+          });
           // console.log(res);
           if (res.success) {
-            this.$message.success("删除成功");
+            this.$message.success("解绑成功");
             let totalPage = Math.ceil((this.total - 1) / this.pageSize);
             let currentPage =
               this.curPage > totalPage ? totalPage : this.curPage;
@@ -904,7 +898,7 @@ export default {
     .order-top {
       display: flex;
       align-items: center;
-      justify-content: space-between;
+      // justify-content: space-between;
       padding: 33px 29px 34px 33px;
       font-size: 16px;
       font-weight: 400;
@@ -912,6 +906,7 @@ export default {
       .add {
         display: flex;
         align-items: center;
+        margin-left: 400px;
       }
       .el-button {
         background-color: rgba(41, 109, 227, 1);

+ 51 - 51
src/views/home/index.vue

@@ -470,7 +470,7 @@ export default {
     // this.API.room.roomSave(arr).then((res) => {
     //   console.log(res);
     // });
-    console.log(this.$router.options.routes);
+    // console.log(this.$router.options.routes);
     window.addEventListener("scroll", this.lazyLoading, true); // 滚动到底部,再加载的处理事件
   },
   //页面离开后销毁,防止切换路由后上一个页面监听scroll滚动事件会在新页面报错问题
@@ -480,7 +480,7 @@ export default {
   },
   watch: {
     date(newVal, oldVal) {
-      console.log(newVal);
+      // console.log(newVal);
       this.$store.commit("user/SET_TIME", this.date);
       this.roomList();
       this.allList();
@@ -538,7 +538,7 @@ export default {
             arrays.push(item);
           });
         });
-        console.log(arrays);
+        // console.log(arrays);
         var res = []; // 层数
         var narr = []; // 每层对应的数组
         for (var i = 0; i < arrays.length; i++) {
@@ -550,7 +550,7 @@ export default {
             narr[n].room.push(...arrays[i].room);
           }
         }
-        console.log(narr);
+        // console.log(narr);
         let ids = [];
         narr.forEach(item => {
           item.room.forEach(item => {
@@ -607,7 +607,7 @@ export default {
               });
             });
           });
-          console.log(citiesNum);
+          // console.log(citiesNum);
 
           this.allData = narr;
           this.citiesNumber = citiesNum;
@@ -618,7 +618,7 @@ export default {
       this.cardShow = true; // 数据加载前
       this.API.room.roomPageGroup({ curPage: 1, pageSize: 200 }).then(res => {
         this.floorRoomDatas = [];
-        console.log(res);
+        // console.log(res);
 
         let arrays = [];
         let lists = resData ? resData : res.data.list;
@@ -644,7 +644,7 @@ export default {
         // console.log(narr);
         // 筛选时传进来的数据代替接口数据(Datas)
         this.floorRoomDatas = Datas ? Datas : narr;
-        console.log(this.floorRoomDatas);
+        // console.log(this.floorRoomDatas);
         let ids = [];
         this.floorRoomDatas.forEach(item => {
           item.room.forEach(item => {
@@ -671,7 +671,7 @@ export default {
           "&" +
           roomIds;
         this.API.roomRealTimeStatu.realData(params).then(res => {
-          console.log(res);
+          // console.log(res);
           this.roomData = res.data;
           this.Data = _.cloneDeep(this.floorRoomDatas);
           this.Data.forEach(items => {
@@ -680,9 +680,9 @@ export default {
               // console.log(item);
               this.roomData.forEach(i => {
                 if (i.electricType == 1) {
-                  i.electricName = "关电";
-                } else {
                   i.electricName = "开电";
+                } else {
+                  i.electricName = "关电";
                 }
                 if (item.id == i.roomId) {
                   item = Object.assign(item, i);
@@ -785,7 +785,7 @@ export default {
       return { background: color[e] };
     },
     EachRoom($event, item) {
-      console.log(item);
+      // console.log(item);
       this.clickId = item.roomId;
     },
 
@@ -796,7 +796,7 @@ export default {
         this.roomList();
       } else {
         this.API.room.roomPageGroup({ roomNo }).then(res => {
-          console.log(res);
+          // console.log(res);
           if (res.data.list.length) {
             this.roomList("", res.data.list);
             this.checkedCities = [];
@@ -812,7 +812,7 @@ export default {
 
     // 批量开关房start
     roomAll() {
-      console.log("点击roomAll-------------------------------");
+      // console.log("点击roomAll-------------------------------");
       this.room = !this.room;
       if (this.data == 0) {
         this.checked = false;
@@ -838,8 +838,8 @@ export default {
       //           });
     },
     chooseAll() {
-      console.log("点击批量房间-----------------------------");
-      console.log(this.data[0].children);
+      // console.log("点击批量房间-----------------------------");
+      // console.log(this.data[0].children);
       if (this.checked) {
         this.$refs.roomTree.setCheckedNodes(this.data[0].children);
         this.count = this.data[0].children;
@@ -855,9 +855,9 @@ export default {
       });
       this.title = e.target.innerText;
       this.checked = false;
-      console.log(this);
+      // console.log(this);
       if (this.title == "批量关房") {
-        console.log("批量关房");
+        // console.log("批量关房");
         this.count = [];
         this.checked = false;
 
@@ -886,7 +886,7 @@ export default {
           });
         }
       } else {
-        console.log("批量开房");
+        // console.log("批量开房");
         this.data[0].children = [];
         this.count = [];
         this.checked = false;
@@ -930,11 +930,11 @@ export default {
         this.checked = false;
       }
 
-      console.log(this.count);
+      // console.log(this.count);
     },
     // 取消选中房间
     cancelCheck(i) {
-      console.log(i);
+      // console.log(i);
       this.count = this.count.filter(item => {
         return i.id != item.id;
       });
@@ -944,7 +944,7 @@ export default {
         this.checked = false;
       }
       this.$refs.roomTree.setCheckedNodes(this.count);
-      console.log(this.count);
+      // console.log(this.count);
     },
     PLcloseRoom() {
       this.dialogVisible = false;
@@ -959,13 +959,13 @@ export default {
         this.count.forEach(item => {
           roomId.push(item.id);
         });
-        console.log(roomId);
+        // console.log(roomId);
         this.$confirm("确认关闭房间吗?")
           .then(_ => {
             this.API.roomRealTimeStatu
               .lock({ roomId, startDate, endDate, remark })
               .then(res => {
-                console.log(res);
+                // console.log(res);
                 if (res.success) {
                   this.$message({
                     message: "关房成功",
@@ -994,7 +994,7 @@ export default {
         this.$confirm("确认开房吗?")
           .then(_ => {
             this.API.roomRealTimeStatu.clean({ statuIds }).then(res => {
-              console.log(res);
+              // console.log(res);
               if (res.success) {
                 this.$message({
                   message: "成功转为空闲房",
@@ -1032,10 +1032,10 @@ export default {
     //脏房转空闲
     leisure(item) {
       // console.log(item);
-      console.log(item.statuId);
+      // console.log(item.statuId);
       let statuIds = [item.statuId];
       this.API.roomRealTimeStatu.clean({ statuIds }).then(res => {
-        console.log(res);
+        // console.log(res);
         if (res.success) {
           this.roomList(this.Data);
           this.allList();
@@ -1051,14 +1051,14 @@ export default {
 
     // 锁定房间
     closeRoom(item) {
-      console.log(item);
+      // console.log(item);
       let roomId = [item.roomId];
       let startDate = dayjs(this.$store.state.user.time).format("YYYY-MM-DD");
       // let startDate = this.$store.state.user.time;
       let endDate = dayjs(new Date())
         .add(36000, "day")
         .format("YYYY-MM-DD");
-      console.log(startDate, endDate);
+      // console.log(startDate, endDate);
 
       // let startDate = "2022-08-23";
       // let endDate = "2022-08-24";
@@ -1066,7 +1066,7 @@ export default {
       this.API.roomRealTimeStatu
         .lock({ roomId, startDate, endDate, remark })
         .then(res => {
-          console.log(res);
+          // console.log(res);
           if (res.success) {
             this.roomList(this.Data);
             this.allList();
@@ -1081,7 +1081,7 @@ export default {
     },
     // 转脏房
     todirty(item) {
-      console.log(item);
+      // console.log(item);
       let roomId = item.roomId;
       let startDay = dayjs(this.date).format("YYYY-MM-DD");
       let endDay = dayjs(this.date)
@@ -1092,7 +1092,7 @@ export default {
       this.API.roomRealTimeStatu
         .toDirty({ roomId, startDay, endDay })
         .then(res => {
-          console.log(res);
+          // console.log(res);
           if (res.success) {
             this.roomList(this.Data);
             this.allList();
@@ -1107,7 +1107,7 @@ export default {
     },
     // 关电
     closeEle(item) {
-      console.log(item);
+      // console.log(item);
       let operType = "";
       let roomId = item.roomId;
       this.$confirm(`确认${item.electricName}吗?`)
@@ -1123,7 +1123,7 @@ export default {
               .changeElectric(roomId, operType)
               .then(res => {
                 reqFlag = false;
-                console.log(res);
+                // console.log(res);
                 if (res.success) {
                   this.roomList(this.Data);
                   this.$message({
@@ -1163,7 +1163,7 @@ export default {
     },
     // 房态筛查
     handleCheckAllChange(val) {
-      console.log(val);
+      // console.log(val);
       this.roomList();
       this.checkedCities = val ? this.cities : [];
       this.isIndeterminate = false;
@@ -1174,7 +1174,7 @@ export default {
       // });
       // this.roomList();
       if (value.length) {
-        console.log(this.Data);
+        // console.log(this.Data);
 
         let array = [];
         let room = [];
@@ -1202,12 +1202,12 @@ export default {
         });
         if (array.length == 0) {
           // this.roomList();
-          console.log("勾选的房间数量为0");
+          // console.log("勾选的房间数量为0");
           this.Data = [];
           this.data[0].children = [];
         } else {
           // this.roomList(array, "");
-          console.log("勾选的房间数量有房间");
+          // console.log("勾选的房间数量有房间");
           this.Data = array;
           this.data[0].children = [];
 
@@ -1229,7 +1229,7 @@ export default {
             });
           });
         }
-        console.log(value);
+        // console.log(value);
       } else {
         this.roomList();
       }
@@ -1261,11 +1261,11 @@ export default {
     },
     // 下发密码
     sending(item) {
-      console.log(item);
+      // console.log(item);
       this.$confirm(`确认下发密码(${item.lockRealtimePassword})吗?`)
         .then(_ => {
           this.API.doorLock.sendPassword(item.id).then(res => {
-            console.log(res);
+            // console.log(res);
             if (res.success) {
               this.$message({
                 message: "下发密码成功",
@@ -1280,16 +1280,16 @@ export default {
         .catch(_ => {});
     },
     roomLock(item) {
-      console.log(item);
+      // console.log(item);
       this.$set(item, "doorLockShow", true);
       // 房间id查询密码锁
       this.API.doorLock.roomDoorLockRoomId(item.roomId).then(res => {
-        console.log(res);
+        // console.log(res);
         this.roomPassWord = res.data;
       });
       // 根据房间id查询(拿到电表码,水表码)
       this.API.roomThirdSetting.settingId(item.roomId).then(res => {
-        console.log(res.data);
+        // console.log(res.data);
         this.doorLockList.id = res.data.id;
         this.doorLockList.roomId = res.data.roomId;
         this.doorLockList.electricityId = res.data.electricId;
@@ -1304,7 +1304,7 @@ export default {
     },
     editLockInput() {
       this.doorLockList.doorIdshow = true;
-      console.log(111);
+      // console.log(111);
     },
 
     // 门锁序列号
@@ -1313,7 +1313,7 @@ export default {
     },
     editRoomNumInput() {
       this.doorLockList.doorNumshow = true;
-      console.log(111);
+      // console.log(111);
     },
 
     // 编辑水表编码
@@ -1322,7 +1322,7 @@ export default {
     },
     editWaterInput() {
       this.doorLockList.waterIdshow = true;
-      console.log(111);
+      // console.log(111);
     },
 
     // 编辑电表编码
@@ -1331,14 +1331,14 @@ export default {
     },
     editEleInput() {
       this.doorLockList.electricityIdshow = true;
-      console.log(111);
+      // console.log(111);
     },
 
     // 修改房间水表码、电表码、锁id
     UpdataRoom(item) {
-      console.log(item);
+      // console.log(item);
       item.doorLockShow = false;
-      console.log(this.doorLockList);
+      // console.log(this.doorLockList);
       let arr = {
         id: this.doorLockList.id,
         roomId: item.roomId,
@@ -1346,7 +1346,7 @@ export default {
         electricId: this.doorLockList.electricityId,
         lockId: this.doorLockList.doorId
       };
-      console.log(arr);
+      // console.log(arr);
       this.$confirm(`确认修改吗?`)
         .then(_ => {
           this.API.roomThirdSetting.Updata(arr).then(res => {
@@ -1356,7 +1356,7 @@ export default {
                 type: "success"
               });
             } else {
-              console.log(res);
+              // console.log(res);
               this.$message.error(res.message);
             }
           });

+ 28 - 34
src/views/icCard/index.vue

@@ -57,8 +57,8 @@
               placeholder="请选择类型"
               @change="getData(1)"
             >
-              <el-option label="普通用户" value="1"></el-option>
-              <el-option label="管理员" value="0"></el-option>
+              <el-option label="普通用户" value="2"></el-option>
+              <el-option label="管理员" value="1"></el-option>
             </el-select>
           </div>
 
@@ -169,6 +169,7 @@
                         width="692px"
                         append-to-body
                         custom-class="dialongAllRoom"
+                        center
                       >
                         <div class="tree">
                           <div class="tree-left">
@@ -213,8 +214,8 @@
                         v-model="icCardInfo.userType"
                         placeholder="用户"
                       >
-                        <el-option label="普通用户" value="1"></el-option>
-                        <el-option label="管理员" value="0"></el-option>
+                        <el-option label="普通用户" value="2"></el-option>
+                        <el-option label="管理员" value="1"></el-option>
                       </el-select>
                     </el-form-item>
                     <el-form-item label="失效时间">
@@ -243,7 +244,7 @@
               </div>
             </el-dialog>
 
-            <div class="export" @click="exportExcel">导出订单</div>
+            <div class="export" @click="exportExcel">导出IC卡</div>
           </div>
         </div>
         <!-- 表格区域 -->
@@ -308,7 +309,7 @@
             <el-table-column align="center" label="用户类型">
               <template slot-scope="scope">
                 <span>{{
-                  scope.row.userType == 1 ? "普通用户" : "管理员"
+                  scope.row.userType == 1 ? "管理员" : "普通用户"
                 }}</span>
               </template>
             </el-table-column>
@@ -435,7 +436,7 @@ export default {
   },
   watch: {
     startTime(newVal, oldVal) {
-      console.log(this.endTime > newVal);
+      // console.log(this.endTime > newVal);
       if (this.endTime <= newVal) {
         this.endTime = "";
       }
@@ -447,7 +448,7 @@ export default {
     this.API.hotelStaff
       .departList()
       .then(res => {
-        console.log(res, "员工类型");
+        // console.log(res, "员工类型");
 
         let data = [];
         res.data.forEach(item => {
@@ -469,7 +470,7 @@ export default {
         });
 
         this.data = data;
-        console.log(data);
+        // console.log(data);
       })
       .catch(err => {
         console.log(err);
@@ -492,7 +493,7 @@ export default {
       params = `${this.roomNo}?curPage=${this.curPage}&pageSize=${this.pageSize}&keyWord=${this.queryValue}&createTime=${this.queryCreateTime}&userType=${this.queryUserType}`;
       // console.log(params);
       let res = await this.API.icCard.icqueryInfo(params);
-      console.log(res);
+      // console.log(res);
       if (res.success) {
         this.tableData = res.data.list;
         this.total = res.data.totalCount;
@@ -502,12 +503,12 @@ export default {
     },
     //新增弹窗
     async addCard(row) {
-      console.log(row);
+      // console.log(row);
       this.addDialogShow = true;
       // 点击编辑
       if (event.target.innerText == "编辑") {
         this.nameValue = "编辑";
-        console.log("编辑");
+        // console.log("编辑");
         this.selectTime = false;
         this.icCardInfo = {
           id: row.id.toString(),
@@ -522,7 +523,7 @@ export default {
         this.startTime = row.takeTime;
         this.endTime = row.failureTime;
       } else if (event.target.innerText == "新增") {
-        console.log("新增");
+        // console.log("新增");
         this.nameValue = "新增";
         this.selectTime = true;
         this.icCardInfo = {
@@ -545,7 +546,7 @@ export default {
     // 保存按钮
     async save() {
       if (this.nameValue == "编辑") {
-        console.log("编辑");
+        // console.log("编辑");
         let params = {
           id: this.icCardInfo.id,
           cardNumber: this.icCardInfo.cardNumber,
@@ -558,10 +559,10 @@ export default {
           createTime: this.startTime,
           statu: this.icCardInfo.statu
         };
-        console.log(params);
+        // console.log(params);
         let res = await this.API.icCard.update(params);
         if (res.success) {
-          console.log(res);
+          // console.log(res);
           this.$message.success(res.message);
           this.addDialogShow = false;
           this.getData();
@@ -569,7 +570,7 @@ export default {
           this.$message.error(res.message);
         }
       } else if (this.nameValue == "新增") {
-        console.log("新增");
+        // console.log("新增");
         let params = {
           cardNumber: this.icCardInfo.cardNumber,
           roomNo: this.icCardInfo.roomNo,
@@ -582,7 +583,7 @@ export default {
         };
         let res = await this.API.icCard.add(params);
         if (res.success) {
-          console.log(res);
+          // console.log(res);
           this.$message.success(res.message);
           this.addDialogShow = false;
           this.getData();
@@ -645,18 +646,11 @@ export default {
 
       websocket.onmessage = function(evt) {
         let data = JSON.parse(evt.data);
-        console.log(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;
@@ -683,13 +677,13 @@ export default {
           label: data.label
         }
       ];
-      console.log(this.count);
+      // console.log(this.count);
       this.$refs.roomTree.setCheckedNodes(this.count);
       this.title = this.count[0].label;
       this.icCardInfo.name = this.count[0].label;
     },
     cancelCheck() {
-      console.log(222);
+      // console.log(222);
       //   if (this.data[0].children.length == this.count.length) {
       //     this.checked = true;
       //   } else {
@@ -708,7 +702,7 @@ export default {
         createTime: this.queryCreateTime
       };
       this.API.icCard.downLoadICInfo(params).then(res => {
-        console.log(res);
+        // console.log(res);
         let name = `${this.roomNo}房IC卡数据`;
         var content = res;
         // var data = new Blob([content],{type:"application/octet-stream;charset=utf-8"});
@@ -785,7 +779,7 @@ export default {
 
     // 多选框按钮操作
     handleSelectionChange(list) {
-      console.log(list);
+      // console.log(list);
       this.selectionTable = list;
     },
 
@@ -1228,8 +1222,8 @@ export default {
   }
 }
 /deep/ .fingerprint {
-  width: 800px;
-  height: 600px;
+  width: 600px;
+  height: 300px;
   .el-dialog__header {
     display: none;
   }
@@ -1260,8 +1254,8 @@ export default {
     }
   }
   .el-footer {
-    height: 350px;
-    margin: 30px auto;
+    // height: 350px;
+    margin: 70px auto;
     font-size: 40px;
     font-weight: 800;
   }

+ 1 - 1
src/views/staff/index.vue

@@ -206,7 +206,7 @@ export default {
     this.API.hotelStaff
       .departList()
       .then(res => {
-        console.log(res, "员工类型");
+        // console.log(res, "员工类型");
         this.options = res.data;
       })
       .catch(err => {