Explorar el Código

完成门锁接口和一些界面的bug问题

hzj18279462576@163.com hace 1 año
padre
commit
82014398c8

+ 5 - 0
package-lock.json

@@ -839,6 +839,11 @@
       "resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
       "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
     },
+    "nprogress": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmmirror.com/nprogress/-/nprogress-0.2.0.tgz",
+      "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA=="
+    },
     "p-limit": {
       "version": "2.3.0",
       "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz",

+ 1 - 0
package.json

@@ -19,6 +19,7 @@
     "hls.js": "^1.3.4",
     "jsencrypt": "^3.3.1",
     "lodash": "^4.17.21",
+    "nprogress": "^0.2.0",
     "qrcode": "^1.5.3",
     "sass": "^1.58.0",
     "sass-loader": "^13.2.0",

BIN
src/assets/icons/nfc.png


+ 5 - 1
src/layout/sidebar/Navbar.vue

@@ -336,8 +336,12 @@ const loginOut = () => {
     .then(() => {
       sessionStorage.removeItem("token");
       sessionStorage.removeItem("id");
-      sessionStorage.removeItem("adminMenuId");
+      sessionStorage.removeItem("user_head");
+      sessionStorage.removeItem("permissionSettingId");
       sessionStorage.removeItem("username");
+      sessionStorage.removeItem("roleList");
+      sessionStorage.removeItem("btnflag");
+      sessionStorage.removeItem("sidevarItem");
       router.push({
         path: `/login`,
       });

+ 115 - 32
src/layout/sidebar/SidevarItem.vue

@@ -16,7 +16,7 @@
         /></el-icon>
       </div>
       <!-- 菜单项 -->
-      <div v-for="item in roles" class="items">
+      <div v-for="item in roleData" class="items">
         <!-- 房态管理 -->
         <el-menu-item
           v-if="item.name == 'roomStatus'"
@@ -37,7 +37,7 @@
           <span>房态管理</span>
         </el-menu-item>
         <!-- 房型管理 -->
-        <el-sub-menu :index="item.name" v-if="item.name == 'roomTypes'">
+        <el-sub-menu :index="item.name" v-if="item.name == 'roomType'">
           <template #title>
             <img
               v-if="
@@ -79,7 +79,7 @@
           <span>订单管理</span>
         </el-menu-item>
         <!-- 授权管理 -->
-        <el-sub-menu :index="item.name" v-if="item.name == 'classs'">
+        <el-sub-menu :index="item.name" v-if="item.name == 'class'">
           <template #title>
             <img
               v-if="
@@ -120,7 +120,7 @@
           <span>统计报表</span>
         </el-menu-item>
         <!-- 设备管理 -->
-        <el-sub-menu :index="item.name" v-if="item.name == 'doorLocks'">
+        <el-sub-menu :index="item.name" v-if="item.name == 'doorLock'">
           <template #title>
             <img
               v-if="
@@ -146,7 +146,7 @@
           </el-menu-item>
         </el-sub-menu>
         <!-- 组织架构 -->
-        <el-sub-menu :index="item.name" v-if="item.name == 'users'">
+        <el-sub-menu :index="item.name" v-if="item.name == 'user'">
           <template #title>
             <img
               v-if="
@@ -172,30 +172,6 @@
           </el-menu-item>
         </el-sub-menu>
         <!-- 账号管理 -->
-        <!-- <el-sub-menu :index="item.name" v-if="item.name == 'accounts'">
-          <template #title>
-            <img
-              v-if="
-                activeIndex == '/hotel/roles' || activeIndex == '/hotel/account'
-              "
-              src="@/assets/icons/accountS.png"
-              style="width: 22px; height: 22px; margin: 0 18px 0 18px"
-              alt=""
-            />
-            <img
-              v-else
-              src="@/assets/icons/account.png"
-              style="width: 22px; height: 22px; margin: 0 18px 0 18px"
-              alt=""
-            />
-            <span>{{ item.meta.title }}</span>
-          </template>
-          <el-menu-item v-for="i in item.children" :index="`/hotel/${i.name}`">
-            <template #title>
-              <span>{{ i.meta.title }}</span>
-            </template>
-          </el-menu-item>
-        </el-sub-menu> -->
         <el-menu-item v-if="item.name == 'account'" index="/hotel/account">
           <img
             v-if="activeIndex == '/hotel/account'"
@@ -270,7 +246,7 @@ const router = useRouter();
 
 const menuClose = ref(false);
 const activeIndex = ref();
-const roles = ref();
+const roleData = ref();
 
 watch(
   () => store.state.user.collapse,
@@ -316,8 +292,115 @@ const handleSelect = (key, keyPath) => {
 };
 onBeforeMount(() => {
   activeIndex.value = sessionStorage.getItem("sidevarItem");
-  roles.value = store.state.user.roles;
-  console.log(roles.value);
+  let arr = JSON.parse(sessionStorage.getItem("roleList"));
+  let roles = [];
+  arr.forEach((i) => {
+    // 房态管理
+    if (i.path == "roomStatus") {
+      roles.push({
+        name: "roomStatus",
+        meta: { isAuth: true, title: "房态管理" },
+      });
+    }
+    // 房型管理
+    else if (i.path == "roomType") {
+      roles.push({
+        name: "roomType",
+        meta: { isAuth: true, title: "房型管理", sign: "roomTypes" },
+        children: [
+          {
+            name: "roomType",
+            meta: { isAuth: true, title: "房型管理" },
+          },
+          {
+            name: "roomPrice",
+            meta: { isAuth: true, title: "房价管理" },
+          },
+        ],
+      });
+    }
+    // 订单管理
+    else if (i.path == "order") {
+      roles.push({
+        name: "order",
+        meta: { isAuth: true, title: "订单管理" },
+      });
+    }
+    // 授权管理
+    else if (i.path == "class") {
+      roles.push({
+        name: "class",
+        meta: { isAuth: true, title: "授权管理", sign: "classs" },
+        children: [
+          {
+            name: "class",
+            meta: { isAuth: true, title: "课表管理" },
+          },
+          {
+            name: "process",
+            meta: { isAuth: true, title: "流程管理" },
+          },
+        ],
+      });
+    }
+    // 统计报表
+    else if (i.path == "statement") {
+      roles.push({
+        name: "statement",
+        meta: { isAuth: true, title: "统计报表" },
+      });
+    }
+    // 设备管理
+    else if (i.path == "doorLock") {
+      roles.push({
+        name: "doorLock",
+        meta: { isAuth: true, title: "设备管理", sign: "doorLocks" },
+        children: [
+          {
+            name: "doorLock",
+            meta: { isAuth: true, title: "门锁管理" },
+          },
+          {
+            name: "meter",
+            meta: { isAuth: true, title: "水电表管理" },
+          },
+        ],
+      });
+    }
+    // 组织架构
+    else if (i.path == "user") {
+      roles.push({
+        name: "user",
+        meta: { isAuth: true, title: "组织架构", sign: "roomTypes" },
+        children: [
+          {
+            name: "user",
+            meta: { isAuth: true, title: "用户管理" },
+          },
+          {
+            name: "userRoles",
+            meta: { isAuth: true, title: "用户角色" },
+          },
+        ],
+      });
+    }
+    // 账号管理
+    else if (i.path == "account") {
+      roles.push({
+        name: "account",
+        meta: { isAuth: true, title: "账号管理" },
+      });
+    }
+    // 系统管理
+    else if (i.path == "system") {
+      roles.push({
+        name: "system",
+        meta: { isAuth: true, title: "系统管理" },
+      });
+    }
+  });
+  roleData.value = roles;
+  console.log(roleData.value,"整理后的路由");
 });
 </script>
 

+ 101 - 118
src/router/index.js

@@ -6,6 +6,9 @@ import {
 import Layout from "@/layout/index.vue";
 import store from "@/store";
 import { ElMessage, ElMessageBox } from "element-plus";
+
+import NProgress from "nprogress";
+import "nprogress/nprogress.css";
 const routes = [
   {
     path: "/login",
@@ -20,90 +23,90 @@ const routes = [
     name: "hotel",
     component: Layout,
     children: [
-      {
-        path: "roomStatus",
-        name: "roomStatus",
-        meta: { isAuth: true, title: "房态管理" },
-        component: () => import("@/views/roomStatus/roomStatus.vue"),
-      },
-      {
-        path: "roomType",
-        name: "roomType",
-        meta: { isAuth: true, title: "房型管理" },
-        component: () => import("@/views/roomType/roomType.vue"),
-      },
-      {
-        path: "roomPrice",
-        name: "roomPrice",
-        meta: { isAuth: true, title: "房价管理" },
-        component: () => import("@/views/roomPrice/roomPrice.vue"),
-      },
-      {
-        path: "order",
-        name: "order",
-        meta: { isAuth: true, title: "订单管理" },
-        component: () => import("@/views/order/order.vue"),
-      },
-      {
-        path: "class",
-        name: "class",
-        meta: { isAuth: true, title: "课表管理" },
-        component: () => import("@/views/class/class.vue"),
-      },
-      {
-        path: "process",
-        name: "process",
-        meta: { isAuth: true, title: "流程管理" },
-        component: () => import("@/views/process/process.vue"),
-      },
-      {
-        path: "statement",
-        name: "statement",
-        meta: { isAuth: true, title: "统计报表" },
-        component: () => import("@/views/statement/statement.vue"),
-      },
-      {
-        path: "user",
-        name: "user",
-        meta: { isAuth: true, title: "用户管理" },
-        component: () => import("@/views/user/user.vue"),
-      },
-      {
-        path: "userRoles",
-        name: "userRoles",
-        meta: { isAuth: true, title: "用户角色" },
-        component: () => import("@/views/userRoles/userRoles.vue"),
-      },
-      {
-        path: "roles",
-        name: "roles",
-        meta: { isAuth: true, title: "角色管理" },
-        component: () => import("@/views/roles/roles.vue"),
-      },
-      {
-        path: "doorLock",
-        name: "doorLock",
-        meta: { isAuth: true, title: "门锁管理" },
-        component: () => import("@/views/doorLock/doorLock.vue"),
-      },
-      {
-        path: "meter",
-        name: "meter",
-        meta: { isAuth: true, title: "水电表管理" },
-        component: () => import("@/views/meter/meter.vue"),
-      },
-      {
-        path: "account",
-        name: "account",
-        meta: { isAuth: true, title: "账号管理" },
-        component: () => import("@/views/account/account.vue"),
-      },
-      {
-        path: "system",
-        name: "system",
-        meta: { isAuth: true, title: "系统设置" },
-        component: () => import("@/views/system/system.vue"),
-      },
+      // {
+      //   path: "roomStatus",
+      //   name: "roomStatus",
+      //   meta: { isAuth: true, title: "房态管理" },
+      //   component: () => import("@/views/roomStatus/roomStatus.vue"),
+      // },
+      // {
+      //   path: "roomType",
+      //   name: "roomType",
+      //   meta: { isAuth: true, title: "房型管理" },
+      //   component: () => import("@/views/roomType/roomType.vue"),
+      // },
+      // {
+      //   path: "roomPrice",
+      //   name: "roomPrice",
+      //   meta: { isAuth: true, title: "房价管理" },
+      //   component: () => import("@/views/roomPrice/roomPrice.vue"),
+      // },
+      // {
+      //   path: "order",
+      //   name: "order",
+      //   meta: { isAuth: true, title: "订单管理" },
+      //   component: () => import("@/views/order/order.vue"),
+      // },
+      // {
+      //   path: "class",
+      //   name: "class",
+      //   meta: { isAuth: true, title: "课表管理" },
+      //   component: () => import("@/views/class/class.vue"),
+      // },
+      // {
+      //   path: "process",
+      //   name: "process",
+      //   meta: { isAuth: true, title: "流程管理" },
+      //   component: () => import("@/views/process/process.vue"),
+      // },
+      // {
+      //   path: "statement",
+      //   name: "statement",
+      //   meta: { isAuth: true, title: "统计报表" },
+      //   component: () => import("@/views/statement/statement.vue"),
+      // },
+      // {
+      //   path: "user",
+      //   name: "user",
+      //   meta: { isAuth: true, title: "用户管理" },
+      //   component: () => import("@/views/user/user.vue"),
+      // },
+      // {
+      //   path: "userRoles",
+      //   name: "userRoles",
+      //   meta: { isAuth: true, title: "用户角色" },
+      //   component: () => import("@/views/userRoles/userRoles.vue"),
+      // },
+      // {
+      //   path: "roles",
+      //   name: "roles",
+      //   meta: { isAuth: true, title: "角色管理" },
+      //   component: () => import("@/views/roles/roles.vue"),
+      // },
+      // {
+      //   path: "doorLock",
+      //   name: "doorLock",
+      //   meta: { isAuth: true, title: "门锁管理" },
+      //   component: () => import("@/views/doorLock/doorLock.vue"),
+      // },
+      // {
+      //   path: "meter",
+      //   name: "meter",
+      //   meta: { isAuth: true, title: "水电表管理" },
+      //   component: () => import("@/views/meter/meter.vue"),
+      // },
+      // {
+      //   path: "account",
+      //   name: "account",
+      //   meta: { isAuth: true, title: "账号管理" },
+      //   component: () => import("@/views/account/account.vue"),
+      // },
+      // {
+      //   path: "system",
+      //   name: "system",
+      //   meta: { isAuth: true, title: "系统设置" },
+      //   component: () => import("@/views/system/system.vue"),
+      // },
       // {
       //   path: "icCard",
       //   name: "icCard",
@@ -127,41 +130,18 @@ const router = createRouter({
 });
 export default router;
 router.beforeEach(async (to, from, next) => {
+  NProgress.start(); // 进度条开始
   let hasRoutes = store.state.user.hasRoutes;
-  if (sessionStorage.getItem("token")) {
-    // if (!hasRoutes || to.path == "/login") {
-    //   console.log("第一次登录也触发");
-    //   store.commit("SET_ROUTES_STATE", true);
-    //   let res = await store.dispatch("login", {
-    //     adminName: sessionStorage.getItem("username"),
-    //     password: sessionStorage.getItem("name"),
-    //   });
-    //   console.log(res, "路由判断登录");
-    //   if (res == "success") {
-    //     if (store.state.user.level == 2) {
-    //       let modules = import.meta.glob("../views/**/*.vue");
-    //       let arr = {
-    //         path: "account",
-    //         name: "account",
-    //         component: modules[`../views/account/account.vue`],
-    //       };
-    //       router.addRoute("seniorCelebrity", arr);
-    //     }
-    //     next({ ...to, replace: true });
-    //   } else {
-    //     sessionStorage.removeItem("token");
-    //     sessionStorage.removeItem("name");
-    //     ElMessage({
-    //       type: "error",
-    //       showClose: true,
-    //       message: res.data.data.message,
-    //       center: true,
-    //     });
-    //   }
-    //   //----------解决
-    //   // next({ path: "/index" }); //----------解决
-    // }
-    next(); //放行
+
+  if (sessionStorage.getItem("token") && sessionStorage.getItem("user_head")) {
+    if (!hasRoutes) {
+      store.commit("ADDROUTE", "");
+      store.commit("SET_ROUTES_STATE", true);
+      next({ ...to, replace: true });
+    } else {
+      console.log("当前无权限信息");
+    }
+    next();
   } else {
     if (to.path == "/login") {
       next();
@@ -170,3 +150,6 @@ router.beforeEach(async (to, from, next) => {
     }
   }
 });
+router.afterEach(() => {
+  NProgress.done() // 进度条结束
+})

+ 588 - 9
src/store/modules/user.js

@@ -9,8 +9,8 @@ const state = {
   activeIndex: "",
   username: "",
   password: "",
-  // api: "/hotel/ihotel/auto", // 线上
-  api: "/ihotel/auto", // 测试
+  api: "/hotel/ihotel/auto", // 线上
+  // api: "/ihotel/auto", // 测试
   islogin: 1,
   hasRoutes: false,
   level: 1,
@@ -251,6 +251,312 @@ const mutations = {
     state.level = value;
     console.log("设置level", value);
   },
+  ADDROUTE: async (state, value) => {
+    let roleList = JSON.parse(sessionStorage.getItem("roleList"));
+    console.log(roleList);
+    if (roleList) {
+      router.addRoute({
+        path: "/hotel",
+        name: "hotel",
+        component: Layout,
+        children: [],
+      });
+      roleList.forEach((item) => {
+        let list = item.route.split("/");
+        let arr = {
+          path: list[2],
+          name: list[2],
+          meta: { isAuth: true, title: item.name },
+          component: () => import(`../../views/${list[2]}/${list[2]}.vue`),
+        };
+        router.addRoute("hotel", arr);
+      });
+      console.log("动态添加路由");
+    }
+  },
+  ROLELIST: async (state, value) => {
+    let datas = {
+      permissionSettingId: value,
+    };
+    let ress = await axios({
+      method: "get",
+      url: state.api + "/login/menuBar",
+      params: datas,
+    });
+    console.log(ress, "菜单权限");
+    let roleList = [];
+    let arrFlag = {};
+    ress.data.data.forEach((i) => {
+      if (i.name == "房态管理") {
+        roleList.push({
+          name: "房态管理",
+          path: "roomStatus",
+          route: "/hotel/roomStatus",
+        });
+        let roomStatus = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "预定") {
+            roomStatus.yuding = j.status;
+          } else if (j.functionPoint == "退房") {
+            roomStatus.tuifang = j.status;
+          } else if (j.functionPoint == "维修") {
+            roomStatus.weixiu = j.status;
+          } else if (j.functionPoint == "关房") {
+            roomStatus.guanfang = j.status;
+          } else if (j.functionPoint == "置脏") {
+            roomStatus.zhizang = j.status;
+          } else if (j.functionPoint == "置净") {
+            roomStatus.zhijing = j.status;
+          } else if (j.functionPoint == "退款") {
+            roomStatus.tuikuan = j.status;
+          } else if (j.functionPoint == "入住") {
+            roomStatus.ruzhu = j.status;
+          } else if (j.functionPoint == "锁房") {
+            roomStatus.suofang = j.status;
+          } else if (j.functionPoint == "换房") {
+            roomStatus.huanfang = j.status;
+          } else if (j.functionPoint == "开房") {
+            roomStatus.kaifang = j.status;
+          }
+        });
+        arrFlag.roomStatus = roomStatus;
+        // sessionStorage.setItem("roomStatus", JSON.stringify(roomStatus));
+      } else if (i.name == "房型管理") {
+        roleList.push({
+          name: "房型管理",
+          path: "roomType",
+          route: "/hotel/roomType",
+        });
+        let roomType = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "添加") {
+            roomType.tianjia = j.status;
+          } else if (j.functionPoint == "修改") {
+            roomType.xiugai = j.status;
+          } else if (j.functionPoint == "删除") {
+            roomType.shanchu = j.status;
+          } else if (j.functionPoint == "批量改价") {
+            roomType.pilianggaijia = j.status;
+          } else if (j.functionPoint == "改价记录") {
+            roomType.gaijiajilu = j.status;
+          }
+        });
+        arrFlag.roomType = roomType;
+        // sessionStorage.setItem("roomType", JSON.stringify(roomType));
+      } else if (i.name == "房价管理") {
+        roleList.push({
+          name: "房价管理",
+          path: "roomPrice",
+          route: "/hotel/roomPrice",
+        });
+        let roomPrice = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "批量改价") {
+            roomPrice.pilianggaijia = j.status;
+          } else if (j.functionPoint == "改价记录") {
+            roomPrice.gaijiajilu = j.status;
+          }
+        });
+        arrFlag.roomPrice = roomPrice;
+        // sessionStorage.setItem("roomPrice", JSON.stringify(roomPrice));
+      } else if (i.name == "订单管理") {
+        roleList.push({
+          name: "订单管理",
+          path: "order",
+          route: "/hotel/order",
+        });
+        let order = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "取消") {
+            order.quxiao = j.status;
+          } else if (j.functionPoint == "详情") {
+            order.xiangqing = j.status;
+          } else if (j.functionPoint == "入住") {
+            order.ruzhu = j.status;
+          } else if (j.functionPoint == "退款") {
+            order.tuikuan = j.status;
+          } else if (j.functionPoint == "退房") {
+            order.tuifang = j.status;
+          } else if (j.functionPoint == "换房") {
+            order.huanfang = j.status;
+          } else if (j.functionPoint == "导出") {
+            order.daochu = j.status;
+          }
+        });
+        arrFlag.order = order;
+        // sessionStorage.setItem("order", JSON.stringify(order));
+      } else if (i.name == "课表管理") {
+        roleList.push({
+          name: "课表管理",
+          path: "class",
+          route: "/hotel/class",
+        });
+        let classs = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "导入值班") {
+            classs.daoruzhiban = j.status;
+          } else if (j.functionPoint == "导出") {
+            classs.daochu = j.status;
+          }
+        });
+        arrFlag.classs = classs;
+        // sessionStorage.setItem("classs", JSON.stringify(classs));
+      } else if (i.name == "流程管理") {
+        roleList.push({
+          name: "流程管理",
+          path: "process",
+          route: "/hotel/process",
+        });
+        let process = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "同意") {
+            process.tongyi = j.status;
+          } else if (j.functionPoint == "驳回") {
+            process.bohui = j.status;
+          } else if (j.functionPoint == "规则设置") {
+            process.guizeshezhi = j.status;
+          }
+        });
+        arrFlag.process = process;
+        // sessionStorage.setItem("process", JSON.stringify(process));
+      } else if (i.name == "统计报表") {
+        roleList.push({
+          name: "统计报表",
+          path: "statement",
+          route: "/hotel/statement",
+        });
+        let statement = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "导出") {
+            statement.daochu = j.status;
+          }
+        });
+        arrFlag.statement = statement;
+        // sessionStorage.setItem("statement", JSON.stringify(statement));
+      } else if (i.name == "门锁管理") {
+        roleList.push({
+          name: "门锁管理",
+          path: "doorLock",
+          route: "/hotel/doorLock",
+        });
+        let doorLock = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "导入") {
+            doorLock.daoru = j.status;
+          } else if (j.functionPoint == "钥匙管理") {
+            doorLock.yaoshiguanli = j.status;
+          } else if (j.functionPoint == "消息列表") {
+            doorLock.xiaoxiliebiao = j.status;
+          } else if (j.functionPoint == "远程开锁") {
+            doorLock.yuanchengkaisuo = j.status;
+          } else if (j.functionPoint == "解绑设备") {
+            doorLock.jiesuoshebei = j.status;
+          } else if (j.functionPoint == "NFC设置") {
+            doorLock.nfcshezhi = j.status;
+          }
+        });
+        arrFlag.doorLock = doorLock;
+        // sessionStorage.setItem("doorLock", JSON.stringify(doorLock));
+      } else if (i.name == "水电表管理") {
+        roleList.push({
+          name: "水电表管理",
+          path: "meter",
+          route: "/hotel/meter",
+        });
+        let meter = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "导出") {
+            meter.daochu = j.status;
+          } else if (j.functionPoint == "导入") {
+            meter.daoru = j.status;
+          }
+        });
+        arrFlag.meter = meter;
+        // sessionStorage.setItem("meter", JSON.stringify(meter));
+      } else if (i.name == "用户管理") {
+        roleList.push({
+          name: "用户管理",
+          path: "user",
+          route: "/hotel/user",
+        });
+        let user = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "添加") {
+            user.tianjia = j.status;
+          } else if (j.functionPoint == "编辑") {
+            user.bianji = j.status;
+          } else if (j.functionPoint == "删除") {
+            user.shanchu = j.status;
+          }
+        });
+        arrFlag.user = user;
+        // sessionStorage.setItem("user", JSON.stringify(user));
+      } else if (i.name == "角色管理") {
+        roleList.push({
+          name: "角色管理",
+          path: "userRoles",
+          route: "/hotel/userRoles",
+        });
+        let userRoles = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "添加") {
+            userRoles.tianjia = j.status;
+          } else if (j.functionPoint == "编辑") {
+            userRoles.bianji = j.status;
+          } else if (j.functionPoint == "删除") {
+            userRoles.shanchu = j.status;
+          }
+        });
+        arrFlag.userRoles = userRoles;
+        // sessionStorage.setItem("userRoles", JSON.stringify(userRoles));
+      } else if (i.name == "账号管理") {
+        roleList.push({
+          name: "账号管理",
+          path: "account",
+          route: "/hotel/account",
+        });
+        let account = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "添加") {
+            account.tianjia = j.status;
+          } else if (j.functionPoint == "编辑") {
+            account.bianji = j.status;
+          } else if (j.functionPoint == "删除") {
+            account.shanchu = j.status;
+          }
+        });
+        arrFlag.account = account;
+        // sessionStorage.setItem("account", JSON.stringify(account));
+      } else if (i.name == "系统管理") {
+        roleList.push({
+          name: "系统管理",
+          path: "system",
+          route: "/hotel/system",
+        });
+        let system = {};
+        i.functionPoints.forEach((j) => {
+          if (j.functionPoint == "退房设置") {
+            system.tuifangshezhi = j.status;
+          } else if (j.functionPoint == "公寓设置") {
+            system.gongyushezhi = j.status;
+          } else if (j.functionPoint == "补助设置") {
+            system.buzhushezhi = j.status;
+          } else if (j.functionPoint == "催缴设置") {
+            system.cuijiaoshezhi = j.status;
+          } else if (j.functionPoint == "设施服务设置") {
+            system.sheshifuwushezhi = j.status;
+          }
+        });
+        arrFlag.system = system;
+        // sessionStorage.setItem("system", JSON.stringify(system));
+      }
+    });
+    console.log(arrFlag,"按钮权限");
+    
+    sessionStorage.setItem("roleList", JSON.stringify(roleList));
+    sessionStorage.setItem("btnflag", JSON.stringify(arrFlag));
+    // window.location.reload();
+  },
 };
 // mutations的值由actions传入(异步)
 const actions = {
@@ -291,13 +597,286 @@ const actions = {
         );
         sessionStorage.setItem("username", res.data.data.userName);
         console.log(res.data.data.userName, "名字账号");
-
-        // commit("LEVEL", res.data.data.level);
-
-        // commit("userName", data.user);
-
-        // commit("roles", asyncRouter);
-        // sessionStorage.setItem("roles", JSON.stringify(asyncRouter));
+        let datas = {
+          permissionSettingId: res.data.data.permissionSettingId,
+        };
+        let ress = await axios({
+          method: "get",
+          url: state.api + "/login/menuBar",
+          params: datas,
+        });
+        console.log(ress, "菜单权限");
+        let roleList = [];
+        let arrFlag = {};
+        ress.data.data.forEach((i) => {
+          if (i.name == "房态管理") {
+            roleList.push({
+              name: "房态管理",
+              path: "roomStatus",
+              route: "/hotel/roomStatus",
+            });
+            let roomStatus = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "预定") {
+                roomStatus.yuding = j.status;
+              } else if (j.functionPoint == "退房") {
+                roomStatus.tuifang = j.status;
+              } else if (j.functionPoint == "维修") {
+                roomStatus.weixiu = j.status;
+              } else if (j.functionPoint == "关房") {
+                roomStatus.guanfang = j.status;
+              } else if (j.functionPoint == "置脏") {
+                roomStatus.zhizang = j.status;
+              } else if (j.functionPoint == "置净") {
+                roomStatus.zhijing = j.status;
+              } else if (j.functionPoint == "退款") {
+                roomStatus.tuikuan = j.status;
+              } else if (j.functionPoint == "入住") {
+                roomStatus.ruzhu = j.status;
+              } else if (j.functionPoint == "锁房") {
+                roomStatus.suofang = j.status;
+              } else if (j.functionPoint == "换房") {
+                roomStatus.huanfang = j.status;
+              } else if (j.functionPoint == "开房") {
+                roomStatus.kaifang = j.status;
+              }
+            });
+            arrFlag.roomStatus = roomStatus;
+            // sessionStorage.setItem("roomStatus", JSON.stringify(roomStatus));
+          } else if (i.name == "房型管理") {
+            roleList.push({
+              name: "房型管理",
+              path: "roomType",
+              route: "/hotel/roomType",
+            });
+            let roomType = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "添加") {
+                roomType.tianjia = j.status;
+              } else if (j.functionPoint == "修改") {
+                roomType.xiugai = j.status;
+              } else if (j.functionPoint == "删除") {
+                roomType.shanchu = j.status;
+              } else if (j.functionPoint == "批量改价") {
+                roomType.pilianggaijia = j.status;
+              } else if (j.functionPoint == "改价记录") {
+                roomType.gaijiajilu = j.status;
+              }
+            });
+            arrFlag.roomType = roomType;
+            // sessionStorage.setItem("roomType", JSON.stringify(roomType));
+          } else if (i.name == "房价管理") {
+            roleList.push({
+              name: "房价管理",
+              path: "roomPrice",
+              route: "/hotel/roomPrice",
+            });
+            let roomPrice = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "批量改价") {
+                roomPrice.pilianggaijia = j.status;
+              } else if (j.functionPoint == "改价记录") {
+                roomPrice.gaijiajilu = j.status;
+              }
+            });
+            arrFlag.roomPrice = roomPrice;
+            // sessionStorage.setItem("roomPrice", JSON.stringify(roomPrice));
+          } else if (i.name == "订单管理") {
+            roleList.push({
+              name: "订单管理",
+              path: "order",
+              route: "/hotel/order",
+            });
+            let order = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "取消") {
+                order.quxiao = j.status;
+              } else if (j.functionPoint == "详情") {
+                order.xiangqing = j.status;
+              } else if (j.functionPoint == "入住") {
+                order.ruzhu = j.status;
+              } else if (j.functionPoint == "退款") {
+                order.tuikuan = j.status;
+              } else if (j.functionPoint == "退房") {
+                order.tuifang = j.status;
+              } else if (j.functionPoint == "换房") {
+                order.huanfang = j.status;
+              } else if (j.functionPoint == "导出") {
+                order.daochu = j.status;
+              }
+            });
+            arrFlag.order = order;
+            // sessionStorage.setItem("order", JSON.stringify(order));
+          } else if (i.name == "课表管理") {
+            roleList.push({
+              name: "课表管理",
+              path: "class",
+              route: "/hotel/class",
+            });
+            let classs = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "导入值班") {
+                classs.daoruzhiban = j.status;
+              } else if (j.functionPoint == "导出") {
+                classs.daochu = j.status;
+              }
+            });
+            arrFlag.classs = classs;
+            // sessionStorage.setItem("classs", JSON.stringify(classs));
+          } else if (i.name == "流程管理") {
+            roleList.push({
+              name: "流程管理",
+              path: "process",
+              route: "/hotel/process",
+            });
+            let process = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "同意") {
+                process.tongyi = j.status;
+              } else if (j.functionPoint == "驳回") {
+                process.bohui = j.status;
+              } else if (j.functionPoint == "规则设置") {
+                process.guizeshezhi = j.status;
+              }
+            });
+            arrFlag.process = process;
+            // sessionStorage.setItem("process", JSON.stringify(process));
+          } else if (i.name == "统计报表") {
+            roleList.push({
+              name: "统计报表",
+              path: "statement",
+              route: "/hotel/statement",
+            });
+            let statement = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "导出") {
+                statement.daochu = j.status;
+              }
+            });
+            arrFlag.statement = statement;
+            // sessionStorage.setItem("statement", JSON.stringify(statement));
+          } else if (i.name == "门锁管理") {
+            roleList.push({
+              name: "门锁管理",
+              path: "doorLock",
+              route: "/hotel/doorLock",
+            });
+            let doorLock = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "导入") {
+                doorLock.daoru = j.status;
+              } else if (j.functionPoint == "禁用门锁") {
+                doorLock.jinyongmensuo = j.status;
+              } else if (j.functionPoint == "钥匙管理") {
+                doorLock.yaoshiguanli = j.status;
+              } else if (j.functionPoint == "消息列表") {
+                doorLock.xiaoxiliebiao = j.status;
+              } else if (j.functionPoint == "远程开锁") {
+                doorLock.yuanchengkaisuo = j.status;
+              } else if (j.functionPoint == "解绑设备") {
+                doorLock.jiesuoshebei = j.status;
+              } else if (j.functionPoint == "NFC设置") {
+                doorLock.nfcshezhi = j.status;
+              }
+            });
+            arrFlag.doorLock = doorLock;
+            // sessionStorage.setItem("doorLock", JSON.stringify(doorLock));
+          } else if (i.name == "水电表管理") {
+            roleList.push({
+              name: "水电表管理",
+              path: "meter",
+              route: "/hotel/meter",
+            });
+            let meter = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "导出") {
+                meter.daochu = j.status;
+              } else if (j.functionPoint == "导入") {
+                meter.daoru = j.status;
+              }
+            });
+            arrFlag.meter = meter;
+            // sessionStorage.setItem("meter", JSON.stringify(meter));
+          } else if (i.name == "用户管理") {
+            roleList.push({
+              name: "用户管理",
+              path: "user",
+              route: "/hotel/user",
+            });
+            let user = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "添加") {
+                user.tianjia = j.status;
+              } else if (j.functionPoint == "编辑") {
+                user.bianji = j.status;
+              } else if (j.functionPoint == "删除") {
+                user.shanchu = j.status;
+              }
+            });
+            arrFlag.user = user;
+            // sessionStorage.setItem("user", JSON.stringify(user));
+          } else if (i.name == "角色管理") {
+            roleList.push({
+              name: "角色管理",
+              path: "userRoles",
+              route: "/hotel/userRoles",
+            });
+            let userRoles = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "添加") {
+                userRoles.tianjia = j.status;
+              } else if (j.functionPoint == "编辑") {
+                userRoles.bianji = j.status;
+              } else if (j.functionPoint == "删除") {
+                userRoles.shanchu = j.status;
+              }
+            });
+            arrFlag.userRoles = userRoles;
+            // sessionStorage.setItem("userRoles", JSON.stringify(userRoles));
+          } else if (i.name == "账号管理") {
+            roleList.push({
+              name: "账号管理",
+              path: "account",
+              route: "/hotel/account",
+            });
+            let account = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "添加") {
+                account.tianjia = j.status;
+              } else if (j.functionPoint == "编辑") {
+                account.bianji = j.status;
+              } else if (j.functionPoint == "删除") {
+                account.shanchu = j.status;
+              }
+            });
+            arrFlag.account = account;
+            // sessionStorage.setItem("account", JSON.stringify(account));
+          } else if (i.name == "系统管理") {
+            roleList.push({
+              name: "系统管理",
+              path: "system",
+              route: "/hotel/system",
+            });
+            let system = {};
+            i.functionPoints.forEach((j) => {
+              if (j.functionPoint == "退房设置") {
+                system.tuifangshezhi = j.status;
+              } else if (j.functionPoint == "公寓设置") {
+                system.gongyushezhi = j.status;
+              } else if (j.functionPoint == "补助设置") {
+                system.buzhushezhi = j.status;
+              } else if (j.functionPoint == "催缴设置") {
+                system.cuijiaoshezhi = j.status;
+              } else if (j.functionPoint == "设施服务设置") {
+                system.sheshifuwushezhi = j.status;
+              }
+            });
+            arrFlag.system = system;
+            // sessionStorage.setItem("system", JSON.stringify(system));
+          }
+        });
+        sessionStorage.setItem("roleList", JSON.stringify(roleList));
+        sessionStorage.setItem("btnflag", JSON.stringify(arrFlag));
 
         resolve("success");
       } else {

+ 6 - 3
src/views/class/class.vue

@@ -177,7 +177,7 @@ const changePriceSelect = ref();
 // 搜索按钮数据
 const searchInput = reactive({
   keyWord: "",
-  createTime: ["2023-09-04", "2023-09-06"],
+  createTime: [],
 });
 
 // 查看员工列表
@@ -271,6 +271,7 @@ const handleUpload = async (file) => {
   });
   console.log(res, "导入课表信息");
   if (res.data.code == 200) {
+    getList()
     ElMessage({
       type: "success",
       showClose: true,
@@ -310,7 +311,7 @@ const importExcel = lodash.debounce(async () => {
   });
   console.log(res, "导出课表信息");
   if (res.status == 200) {
-    let name = `改价记录数据`;
+    let name = `课表数据`;
     var content = res.data;
     var datas = new Blob([content]);
     var downloadUrl = window.URL.createObjectURL(datas);
@@ -360,7 +361,9 @@ const handleCurrentChange2 = (value) => {
 
 onBeforeMount(async () => {
   api.value = store.state.user.api;
-
+  const startTime=dayjs().format('YYYY-MM-DD');
+  const endTime=dayjs(startTime).add(6,'day').format('YYYY-MM-DD')
+  searchInput.createTime=[startTime,endTime]
   // const data = {
   //   managerId: sessionStorage.getItem("token"),
   // };

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1487 - 664
src/views/doorLock/doorLock.vue


+ 5 - 3
src/views/login/index.vue

@@ -130,13 +130,15 @@ const handleLogin = (formEl) => {
       } catch (e) {
         console.log(e);
       }
-      console.log(res);
+      console.log(res,'登录');
       // // sessionStorage.setItem("name", ruleForm.pass);
       if (res == "success") {
-        router.push({ path: `/hotel/roomStatus` });
+        let roleList = JSON.parse(sessionStorage.getItem("roleList"));
+        let ind=roleList[0].route
+        router.push({ path: ind });
         // store.commit("indexUp", "/seniorCelebrity/order");
         // sessionStorage.setItem("username", ruleForm.user);
-        sessionStorage.setItem("sidevarItem", "/hotel/roomStatus");
+        sessionStorage.setItem("sidevarItem", ind);
         ElMessage({
           type: "success",
           showClose: true,

+ 154 - 62
src/views/meter/meter.vue

@@ -29,6 +29,7 @@
               value-format="YYYY-MM-DD"
               :prefix-icon="Calendar"
               placeholder="请选择日期"
+              @change="searchBtn"
             />
           </div>
           <el-button
@@ -50,12 +51,35 @@
             @click="addClick"
             ><span>添加</span></el-button
           >
-          <el-button type="primary" color="rgba(0, 97, 255, 1)" @click="addlist"
+          <el-button
+            @click="exportExcel"
+            type="primary"
+            color="rgba(0, 97, 255, 1)"
             ><span>导出</span></el-button
           >
-          <el-button type="primary" color="rgba(0, 97, 255, 1)" @click="addlist"
-            ><span>导入</span></el-button
+          <el-upload
+            class="avatar-uploader"
+            action=""
+            :on-preview="handlePreview"
+            :on-remove="handleRemove"
+            :on-change="handleChange"
+            :http-request="handleUpload"
+            :before-upload="beforeAvatarUpload"
           >
+            <template #trigger>
+              <el-button type="primary" color="rgba(0, 97, 255, 1)"
+                >导入</el-button
+              >
+            </template>
+            <template #tip>
+              <!-- <div class="el-upload__tip">
+                    (注:图片大小不超过10M,建议按16:9比例)
+                  </div> -->
+            </template>
+          </el-upload>
+          <!-- <el-button @click="importClick" type="primary" color="rgba(0, 97, 255, 1)"
+            ><span>导入</span></el-button
+          > -->
         </div>
       </div>
       <div class="footer" v-loading="loading">
@@ -87,6 +111,14 @@
             prop="electricEquipmentMeterName"
             label="电表编码"
           />
+          <el-table-column align="center" prop="houseName" label="房型">
+            <template #default="{ row }">
+              {{ row.houseName
+              }}<span style="color: rgb(30, 125, 251)"
+                >( {{ row.roomType == 1 ? "全" : "钟" }} )</span
+              >
+            </template>
+          </el-table-column>
           <el-table-column align="center" prop="roomNumber" label="房间号" />
           <el-table-column align="center" prop="createTime" label="创建时间" />
           <el-table-column align="center" label="操作" width="200">
@@ -307,7 +339,7 @@ const editVisible = ref(false);
 const editRef = ref();
 const keyWord = ref(); // 房间号搜索
 const editCurrentPage = ref(1); // 当前页
-const editPageSize = ref(10);
+const editPageSize = ref(100);
 const editPageTotal = ref(); // 总页数
 const editRuleForm = reactive({
   SB_encoding: "",
@@ -347,6 +379,10 @@ const getList = async () => {
     keyWord: searchInput.keyWord, // 房型名称
     permissionSettingId: sessionStorage.getItem("permissionSettingId"),
   };
+  if (searchInput.createTime) {
+    data.startTime = searchInput.createTime[0];
+    data.endTime = searchInput.createTime[1];
+  }
   let res = await axios({
     method: "get",
     url: api.value + "/house-number/list",
@@ -359,8 +395,8 @@ const getList = async () => {
   console.log(res, "水电表管理");
   if (res.data.code == 200) {
     loading.value = false;
-    tableData.list = res.data.data.records;
-    total.value = res.data.data.total;
+    tableData.list = res.data.data.list;
+    total.value = res.data.data.totalCount;
     // ElMessage({
     //   type: "success",
     //   showClose: true,
@@ -455,9 +491,9 @@ const editClick = async (row) => {
   editVisible.value = true;
   editRuleForm.SB_encoding = row.waterEquipmentMeterName;
   editRuleForm.DB_encoding = row.electricEquipmentMeterName;
-  roomNumClick().then(()=>{
+  roomNumClick().then(() => {
     editRuleForm.roomNum = row.id;
-  })
+  });
 };
 // 确定编辑
 const confirmEdit = (formEl) => {
@@ -484,7 +520,7 @@ const confirmEdit = (formEl) => {
         if (res.data.code == 200) {
           editVisible.value = false;
           editRef.value.resetFields();
-          getList()
+          getList();
           ElMessage({
             type: "success",
             showClose: true,
@@ -519,7 +555,7 @@ const confirmEdit = (formEl) => {
         if (res.data.code == 200) {
           editVisible.value = false;
           editRef.value.resetFields();
-          getList()
+          getList();
           ElMessage({
             type: "success",
             showClose: true,
@@ -574,7 +610,7 @@ const cancelEdit = () => {
 const del = async (row) => {
   let data = {
     houseNumberId: row.id,
-    permissionSettingId:sessionStorage.getItem("permissionSettingId")
+    permissionSettingId: sessionStorage.getItem("permissionSettingId"),
   };
   let res = await axios({
     method: "post",
@@ -612,57 +648,107 @@ const handleSelectionChange = (val) => {
   console.log(val);
   selectData.list = val;
 };
+
+// 导入 (--------------------------------------------------------------)
+const handleRemove = (uploadFile, uploadFiles) => {
+  // console.log(uploadFile.uid, uploadFiles);
+};
+// 点击图片的查看按钮
+const handlePreview = (file) => {
+  // console.log(file);
+};
+// 限制上传图片的大小
+const beforeAvatarUpload = (rawFile) => {
+  console.log(rawFile.type);
+  // if (rawFile.type !== "image/jpeg") {
+  //   ElMessage.error("图片格式必须为JPG/PNG格式!");
+  //   return false;
+  // } 
+  // return true;
+};
+// 添加照片时往fileList列表中添加图片信息
+const handleChange = async (file, fileLists) => {
+  // console.log(file, "1111");
+};
+// 可以获取图片参数
+const handleUpload = async (file) => {
+  console.log(file, "22222222");
+  let data = new FormData();
+  data.set("file", file.file);
+  let res = await axios({
+    method: "post",
+    url: api.value + "/house-number/importList",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("user_head"),
+    },
+    data: data,
+  });
+  console.log(res, "导入水电表信息");
+  if (res.data.code == 200) {
+    getList()
+    ElMessage({
+      type: "success",
+      showClose: true,
+      message: res.data.message,
+      center: true,
+    });
+  } else {
+    ElMessage({
+      type: "error",
+      showClose: true,
+      message: res.data.message,
+      center: true,
+    });
+  }
+};
+
 //导出功能
-// const importExcel = async () => {
-//   if (searchInput.createTime == null) {
-//     searchInput.createTime = "";
-//   }
-//   let data = new FormData();
-//   data.set("car_number", searchInput.carnumber);
-//   data.set("create_time", searchInput.createTime);
-//   let res = await axios({
-//     method: "post",
-//     url: api.value + "/carBook/cinfotoExcel.action",
-//     headers: {
-//       token: sessionStorage.getItem("token"),
-//     },
-//     data: data,
-//   });
-//   // console.log(res, "导出账号");
-//   if (res.data.code == 200) {
-//     // const elt = document.createElement("a");
-//     // elt.setAttribute(
-//     //   "href",
-//     //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
-//     // );
-//     // elt.setAttribute("download", "file.png");
-//     // elt.style.display = "none";
-//     // document.body.appendChild(elt);
-//     // elt.click();
-//     var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
-//     console.log("获得地址数据:", downloadPath);
-//     var downloadLink = document.createElement("a");
-//     downloadLink.style.display = "none"; // 使其隐藏
-//     downloadLink.href = downloadPath;
-//     downloadLink.download = "";
-//     downloadLink.click();
-//     document.body.appendChild(downloadLink);
-//     document.body.removeChild(downloadLink);
-//     ElMessage({
-//       type: "success",
-//       showClose: true,
-//       message: res.data.message,
-//       center: true,
-//     });
-//   } else {
-//     ElMessage({
-//       type: "error",
-//       showClose: true,
-//       message: res.data.message,
-//       center: true,
-//     });
-//   }
-// };
+const exportExcel = async () => {
+  let data = {
+    keyWord: searchInput.keyWord, // 房型名称
+    permissionSettingId: sessionStorage.getItem("permissionSettingId"),
+  };
+  if (searchInput.createTime) {
+    data.startTime = searchInput.createTime[0];
+    data.endTime = searchInput.createTime[1];
+  }
+  let res = await axios({
+    method: "get",
+    url: api.value + "/house-number/listExport",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("userhead"),
+    },
+    params: data,
+    responseType: "blob",
+  });
+  console.log(res, "水电表数据");
+  if (res.status == 200) {
+    let name = `水电表数据`;
+    var content = res.data;
+    var datas = new Blob([content]);
+    var downloadUrl = window.URL.createObjectURL(datas);
+    var anchor = document.createElement("a");
+    anchor.href = downloadUrl;
+    anchor.download = name + ".xlsx";
+    anchor.click();
+    window.URL.revokeObjectURL(datas);
+    ElMessage({
+      type: "success",
+      showClose: true,
+      message: "导出成功",
+      center: true,
+    });
+  } else {
+    ElMessage({
+      type: "error",
+      showClose: true,
+      message: res.data.message,
+      center: true,
+    });
+  }
+};
 // 表格斑马纹颜色修改
 const tableRowClassName = ({ row, rowIndex }) => {
   if (rowIndex % 2 === 0) {
@@ -754,13 +840,19 @@ onUnmounted(() => {
 
     .gongneng {
       margin: 10px 0 20px 0;
-
+      display:flex;
       span {
         color: #fff;
       }
       .el-button {
         margin-right: 10px;
       }
+      .avatar-uploader{
+        margin-left:10px;
+        :deep(.el-upload-list){
+          display:none;
+        }
+      }
     }
 
     :deep(.cont) {

+ 70 - 32
src/views/order/order.vue

@@ -279,6 +279,21 @@
           </el-table-column>
           <el-table-column
             align="center"
+            prop="orderStatusName"
+            label="订单状态"
+            width="120"
+          >
+            <template #default="{ row }">
+              <div style="color: #000" v-if="row.orderChannel == 1">
+                移动端订单
+              </div>
+              <div style="color: #000" v-if="row.orderChannel == 2">
+                管理端订单
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
             width="180"
             prop="payTime"
             label="支付时间"
@@ -288,13 +303,12 @@
             width="180"
             prop="refundTime"
             label="退款时间"
-          />
-          <!-- <el-table-column
-            align="center"
-            width="180"
-            prop="houseName"
-            label="退房时间"
-          /> -->
+          ><template #default="{ row }">
+              <span v-if="row.refundTime">{{
+                dayjs(row.refundTime).format("YYYY-MM-DD HH:mm:ss")
+              }}</span>
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             width="180"
@@ -353,7 +367,7 @@
                 <span
                   v-if="scope.row.orderStart == 3"
                   style="cursor: pointer; margin: 0 10px"
-                  @click="orderInfo(scope.row)"
+                  @click="orderliveRoom(scope.row)"
                   >入住</span
                 >
                 <!-- 退房 -->
@@ -373,7 +387,7 @@
                 </el-popconfirm>
                 <!-- 退款 -->
                 <el-popconfirm
-                  v-if="scope.row.orderStart == 2"
+                  v-if="scope.row.orderStart == 2 || scope.row.orderStart == 3"
                   width="220"
                   confirm-button-text="确认"
                   cancel-button-text="取消"
@@ -860,9 +874,9 @@
           </div>
           <div
             class="roomChangeFooter"
-            v-if="
-              checkInRuleForm.orderStatus == 1 ||
-              checkInRuleForm.orderStatus == 2
+            v-if="checkInRuleForm.orderStatus ==1 ||
+              checkInRuleForm.orderStatus == 2 ||
+              checkInRuleForm.orderStatus == 3
             "
           >
             <div class="options">
@@ -926,7 +940,7 @@
                 </div>
               </el-form-item>
               <el-form-item label="付款方式 :" prop="type">
-                <div v-if="checkInRuleForm.orderStatus != 2">
+                <div v-if="checkInRuleForm.orderStatus != 2 || checkInRuleForm.orderStatus != 3">
                   <el-select
                     v-model="payPriceRuleForm.type"
                     class="m-2"
@@ -947,7 +961,7 @@
                   </el-button>
                 </div>
                 <span v-else style="color: #09ae22">{{
-                  checkInRuleForm.orderStatus == 2
+                  checkInRuleForm.orderStatus == 2 || checkInRuleForm.orderStatus == 3
                     ? "当前订单已支付,可直接入住"
                     : ""
                 }}</span>
@@ -958,7 +972,7 @@
             <div class="options">
               <el-button
                 v-if="
-                  checkInRuleForm.orderStatus == 2 || payPriceRuleForm.type == 2
+                  checkInRuleForm.orderStatus == 2 || checkInRuleForm.orderStatus == 2 || payPriceRuleForm.type == 2
                 "
                 color="rgba(41, 109, 227, 1)"
                 type="primary"
@@ -1751,7 +1765,7 @@ const readFingerprint = () => {
         websocket.send(JSON.stringify(params));
       }
     } else if (data.type == 31) {
-      infoRuleForm.fingerprintNum = data.data.template;
+      checkInRuleForm.fingerprintNum = data.data.template;
       console.log(data.data.template, "指纹数据");
       addFingerprintVisible.value = false;
       ws.value.close();
@@ -1780,9 +1794,9 @@ const readFingerprint = () => {
 };
 const cancelAddFingerprint = () => {
   addFingerprintVisible.value = false;
-  checkInRuleForm.icCard = "";
+  // checkInRuleForm.icCard = "";
   // checkInRuleForm.fingerprintNum = "";
-  checkInRuleForm.pass = "";
+  // checkInRuleForm.pass = "";
   ws.value.close();
 };
 // 选择日期时间段
@@ -1885,6 +1899,7 @@ const Card = () => {
         setTimeout(() => {
           identityCardIndex.value = 3;
           identityCardTitle.value = "读卡成功";
+          addIdentityCardVisible.value = false;
         }, 1500);
       }
     }
@@ -1898,7 +1913,7 @@ const readIcCard = () => {
 };
 const cancelAddIdentityCard = () => {
   addIdentityCardVisible.value = false;
-  checkInRef.value.resetFields();
+  // checkInRef.value.resetFields();
 };
 // 重试 身份卡
 const retry = () => {
@@ -2340,34 +2355,57 @@ const orderCheckout = async (row) => {
 // 退款
 const orderPayout = async (row) => {
   console.log(row, "退款");
-  let datas = {
+  let data = {
     orderNumber: row.orderNumber,
     houseNumberId: row.houseNumberId,
     usersId: sessionStorage.getItem("id"),
   };
-  let ress = await axios({
+  let res = await axios({
     method: "post",
     url: api.value + "/house-order/cancelApplet",
     headers: {
       token: sessionStorage.getItem("token"),
       user_head: sessionStorage.getItem("user_head"),
     },
-    data: datas,
+    data: data,
   });
-  console.log(ress, "房态管理-退款");
-  if (ress.data.code == 200) {
-    getList();
-    ElMessage({
-      type: "success",
-      showClose: true,
-      message: ress.data.message,
-      center: true,
-    });
+  console.log(res, "房态管理-退款");
+  if (res.data.code == 200) {
+    setTimeout(async () => {
+      let datas=new FormData()
+      datas.append('refundNo',row.id)
+      let ress = await axios({
+        method: "post",
+        url: api.value + "/house-order/queryRefundById",
+        headers: {
+          token: sessionStorage.getItem("token"),
+          user_head: sessionStorage.getItem("user_head"),
+        },
+        data: datas,
+      });
+      console.log(ress, "微信支付查询退款");
+      if (ress.data.data.code == 200) {
+        getList();
+        ElMessage({
+          type: "success",
+          showClose: true,
+          message: ress.data.data.message,
+          center: true,
+        });
+      } else {
+        ElMessage({
+          type: "error",
+          showClose: true,
+          message: ress.data.data.message,
+          center: true,
+        });
+      }
+    }, 1500);
   } else {
     ElMessage({
       type: "error",
       showClose: true,
-      message: ress.data.message,
+      message: res.data.message,
       center: true,
     });
   }

+ 2 - 2
src/views/process/process.vue

@@ -240,8 +240,8 @@
             >
               <template #default="{ row }">
                 <div class="options">
-                  <div class="agree" v-if="row.status==1" @click="agreeRemarksClick(row)">同意</div>
-                  <div class="reject" v-if="row.status==1" @click="rejectRemarksClick(row)">
+                  <div class="agree" v-if="row.status==1  || row.status==2" @click="agreeRemarksClick(row)">同意</div>
+                  <div class="reject" v-if="row.status==1 || row.status==2" @click="rejectRemarksClick(row)">
                     驳回
                   </div>
                 </div>

+ 49 - 27
src/views/roomPrice/roomPrice.vue

@@ -160,6 +160,7 @@
                       value-format="YYYY-MM-DD"
                       :prefix-icon="Calendar"
                       placeholder="请选择日期"
+                      :clearable="false"
                     />
                     <img
                       src="@/assets/addRoom.png"
@@ -669,7 +670,16 @@ const cancelRoomClose = () => {
 };
 // 批量改价中表格设置价格按钮
 const inputPrice = (row) => {
-  console.log(typeList.value);
+  console.log(typeList.value,row.roomPrice);
+  // if(row.roomPrice<0.01){
+  //   row.roomPrice = ""
+  //   ElMessage({
+  //     type: "warning",
+  //     showClose: true,
+  //     message: "最低价格为0.01元,请重新设置",
+  //     center: true,
+  //   });
+  // }
 };
 
 // 勾选房间类型后表格添加相应的数据
@@ -733,36 +743,48 @@ const notarizeRoomClose = async () => {
     })
   })
   console.log(arr);
-  let data = {
-    alterDtoList: arr,
-    adminId: sessionStorage.getItem("permissionSettingId")
-  }
-  let res = await axios({
-    method: "post",
-    url: api.value + "/house-price/alterPrice",
-    headers: {
-      token: sessionStorage.getItem("token"),
-      user_head: sessionStorage.getItem("userhead"),
-    },
-    data: data,
-  });
-  console.log(res, "确定改价");
-  if (res.data.code == 200) {
-    getList();
-    roomCloseDialogVisible.value = false;
-    changePriceData.list = [];
-    changePriceData.typeData = [];
-    ElMessage({
-      type: "success",
-      showClose: true,
-      message: res.data.message,
-      center: true,
+  let flag=arr.every(i=>{
+    return i.price>=0.01&& i.price!=''
+  })
+  if(flag){
+    let data = {
+      alterDtoList: arr,
+      adminId: sessionStorage.getItem("permissionSettingId")
+    }
+    let res = await axios({
+      method: "post",
+      url: api.value + "/house-price/alterPrice",
+      headers: {
+        token: sessionStorage.getItem("token"),
+        user_head: sessionStorage.getItem("userhead"),
+      },
+      data: data,
     });
+    console.log(res, "确定改价");
+    if (res.data.code == 200) {
+      getList();
+      roomCloseDialogVisible.value = false;
+      changePriceData.list = [];
+      changePriceData.typeData = [];
+      ElMessage({
+        type: "success",
+        showClose: true,
+        message: res.data.message,
+        center: true,
+      });
+    }else{
+      ElMessage({
+        type: "error",
+        showClose: true,
+        message: res.data.message,
+        center: true,
+      });
+    }
   }else{
     ElMessage({
-      type: "error",
+      type: "warning",
       showClose: true,
-      message: res.data.message,
+      message: '价格设置有误或价格不能为空',
       center: true,
     });
   }

+ 56 - 11
src/views/roomStatus/roomStatus.vue

@@ -2080,7 +2080,7 @@
               </div>
             </el-form-item>
             <el-form-item label="付款方式 :" prop="type">
-              <div v-if="checkInRuleForm.orderStatus != 2">
+              <div v-if="checkInRuleForm.orderStatus != 2 || checkInRuleForm.orderStatus != 3">
                 <el-select
                   v-model="payPriceRuleForm.type"
                   class="m-2"
@@ -2101,7 +2101,7 @@
                 </el-button>
               </div>
               <span v-else style="color: #09ae22">{{
-                  checkInRuleForm.orderStatus == 2
+                  checkInRuleForm.orderStatus == 2 || checkInRuleForm.orderStatus == 3
                     ? "当前订单已支付,可直接入住"
                     : ""
                 }}</span>
@@ -2111,7 +2111,7 @@
         <div class="roomChangeFooter">
           <div class="options">
             <el-button
-              v-if="checkInRuleForm.orderStatus == 2 || payPriceRuleForm.type == 2"
+              v-if="checkInRuleForm.orderStatus == 2 || checkInRuleForm.orderStatus == 3 || payPriceRuleForm.type == 2"
               color="rgba(41, 109, 227, 1)"
               type="primary"
               @click="configPayPrice(payPriceRef)"
@@ -4009,6 +4009,7 @@ const reserveClick =async (i) => {
   });
   console.log(res, "判断房间是否绑定了设备");
   if (res.data.data.binging==1) {
+    dayData();
     reserveVisible.value = true;
     console.log(i, "预定");
     reserveRuleForm.type = i.roomType; // 类型
@@ -4033,7 +4034,6 @@ const reserveClick =async (i) => {
     if (reserveRuleForm.liveTime) {
       liveTimeClick();
     }
-    dayData();
   } else {
     ElMessage({
       type: "warning",
@@ -4573,6 +4573,7 @@ const Card = () => {
         setTimeout(() => {
           identityCardIndex.value = 3;
           identityCardTitle.value = "读卡成功";
+          addIdentityCardVisible.value = false;
         }, 1500);
       }
 
@@ -5027,10 +5028,32 @@ const logHandleCurrentChange = (value) => {
 };
 
 // 锁房页面
-const lockRoomClick = (row) => {
-  lockRoomVisible.value = true;
-  console.log(row, "锁房row");
-  lockRoomRuleForm.houseNumberId = row.houseNumberId;
+const lockRoomClick =async (row) => {
+  let data = {
+    houseNumberId: row.houseNumberId,
+  };
+  let res = await axios({
+    method: "get",
+    url: api.value + "/house-lock/ifBinging",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("user_head"),
+    },
+    params: data,
+  });
+  console.log(res, "判断房间是否绑定了设备");
+  if (res.data.data.binging==1) {
+    lockRoomVisible.value = true;
+    console.log(row, "锁房row");
+    lockRoomRuleForm.houseNumberId = row.houseNumberId;
+  }else {
+    ElMessage({
+      type: "warning",
+      showClose: true,
+      message: '当前房间未绑定门锁设备',
+      center: true,
+    });
+  }
 };
 const cancelLockRoom = () => {
   lockRoomRef.value.resetFields();
@@ -5104,9 +5127,31 @@ const unlockClick = lodash.debounce(async (row) => {
 }, 1500);
 
 // 维修页面
-const maintainClick = (row) => {
-  maintainVisible.value = true;
-  maintainRuleForm.houseNumberId = row.houseNumberId;
+const maintainClick =async (row) => {
+  let data = {
+    houseNumberId: row.houseNumberId,
+  };
+  let res = await axios({
+    method: "get",
+    url: api.value + "/house-lock/ifBinging",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("user_head"),
+    },
+    params: data,
+  });
+  console.log(res, "判断房间是否绑定了设备");
+  if (res.data.data.binging==1) {
+    maintainVisible.value = true;
+    maintainRuleForm.houseNumberId = row.houseNumberId;
+  }else {
+    ElMessage({
+      type: "warning",
+      showClose: true,
+      message: '当前房间未绑定门锁设备',
+      center: true,
+    });
+  }
 };
 const cancelMaintain = () => {
   maintainVisible.value = false;

+ 1 - 1
src/views/roomType/roomType.vue

@@ -76,7 +76,7 @@
             v-if="searchInput.type == 2"
             align="center"
             prop="time"
-            label="点时长"
+            label="点时长"
           />
           <el-table-column align="center" prop="name" label="房型" />
           <el-table-column align="center" prop="roomId" label="房号" />

+ 11 - 5
src/views/system/system.vue

@@ -34,10 +34,10 @@
                 <div class="pre" @click="infoImgClick2('right')">
                   <img src="@/assets/right.png" alt="" />
                 </div>
-                <span class="numImg">{{
+                <span class="numImg" v-if="systemData.coverPicture">{{
                   switchImgInd2 + 1 + "/" + systemData.coverPicture.length
                 }}</span>
-                <div class="lookImg" v-if="systemData.coverPicture.length">
+                <div class="lookImg" v-if="systemData.coverPicture">
                   <img src="@/assets/lookImg.png" alt="" @click="lookImg" />
                   <div class="delimg" @click="delImgList(item)"></div>
                 </div>
@@ -589,7 +589,11 @@ const getList = async () => {
   console.log(res, "系统设置信息");
   if (res.data.code == 200) {
     systemData.address = res.data.data.address;
-    systemData.coverPicture = res.data.data.coverPicture;
+    if(res.data.data.coverPicture){
+      systemData.coverPicture = res.data.data.coverPicture;
+    }else{
+      systemData.coverPicture =[]
+    }
     systemData.decorationTime = res.data.data.decorationTime;
     systemData.id = res.data.data.id;
     systemData.introductory = res.data.data.introductory;
@@ -835,7 +839,7 @@ const handleAddtableUpload = async (file) => {
   });
   console.log(res, "成功上传图片");
   if (res.data.code == 200) {
-    addtableRuleForm.icon = "http://" + res.data.data.url;
+    addtableRuleForm.icon =  res.data.data.url;
   } else {
     ElMessage({
       type: "error",
@@ -1152,8 +1156,10 @@ const handleUpload2 = async (file) => {
   });
   console.log(res, "成功上传图片");
   if (res.data.code == 200) {
+    console.log(systemData.coverPicture);
+    
     systemData.coverPicture.push({
-      url: "http://" + res.data.data.url,
+      url: res.data.data.url,
       count: systemData.coverPicture.length,
     });
     systemChange();

+ 32 - 37
src/views/user/user.vue

@@ -79,17 +79,19 @@
           />
           <el-table-column align="center" prop="userName" label="姓名" />
           <el-table-column align="center" prop="phone" label="手机号码" />
-          <el-table-column align="center" prop="userMenuId" label="角色">
+          <!-- <el-table-column align="center" prop="userMenuId" label="角色">
             <template #default="{ row }">
               <span>{{ row.userMenuName }}</span>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column align="center" prop="department" label="身份" >
             <template #default="{ row }">
               <span v-if="row.department==0">其他</span>
               <span v-if="row.department==1">学生</span>
               <span v-if="row.department==4">教职工</span>
               <span v-if="row.department==5">校友</span>
+              <span v-if="row.department==6">访客应用身份</span>
+              <span v-if="row.department==7">临时人员</span>
             </template>
           </el-table-column>
           <el-table-column
@@ -164,9 +166,11 @@
               class="m-2"
               placeholder="请选择身份"
             >
-            <el-option label="学生" value="1" />
-            <el-option label="教职工" value="4" />
-            <el-option label="校友" value="5" />
+              <el-option label="学生" value="1" />
+              <el-option label="教职工" value="4" />
+              <el-option label="校友" value="5" />
+              <el-option label="访客应用身份" value="6" />
+              <el-option label="临时人员" value="7" />
               <el-option label="其他" value="0" />
             </el-select>
           </el-form-item>
@@ -181,12 +185,12 @@
           <el-form-item label="电话号码 :" prop="userPhone">
             <el-input
               v-model="editRuleForm.userPhone"
-              placeholder="请输入用户名"
+              placeholder="请输入电话号码"
               clearable
               style="width: 500px"
             />
           </el-form-item>
-          <el-form-item label="用户角色 :" prop="userRoles">
+          <!-- <el-form-item label="用户角色 :" prop="userRoles">
             <el-tree
               ref="userRolesRef"
               style="max-width: 600px"
@@ -198,17 +202,7 @@
               default-expand-all
               @check="(data, nodes) => editMemberCheckChange(data, nodes)"
             />
-            <!-- <el-cascader
-              v-model="editRuleForm.userRoles"
-              :options="rolesData.list"
-              clearable
-              :show-all-levels="false"
-              :props="{ label: 'name', value: 'id', checkStrictly: true }"
-              @change="userhandleChange"
-              placeholder="请选择用户角色"
-              style="width: 500px"
-            /> -->
-          </el-form-item>
+          </el-form-item> -->
           <el-form-item label="微校卡号 :" prop="schoolCard">
             <el-input
               v-model="editRuleForm.schoolCard"
@@ -446,25 +440,25 @@ const editRules = reactive({
     {
       required: true,
       message: "身份证号不能为空",
-      trigger: "blur",
+      trigger: "change",
     },
   ],
   fingerprint: [
     {
       required: true,
       message: "指纹不能为空",
-      trigger: "blur",
+      trigger: "change",
     },
   ],
 });
 // 添加用户(---------------------------------------------------------)
 const editMemberCheckChange = (data, nodes) => {
   console.log(data, nodes);
-  userRolesRef.value.setCheckedKeys([]);
-  nextTick(() => {
-    userRolesRef.value.setCheckedKeys([data.id]);
-    editRuleForm.userRoles = data.id;
-  });
+  // userRolesRef.value.setCheckedKeys([]);
+  // nextTick(() => {
+  //   userRolesRef.value.setCheckedKeys([data.id]);
+  //   editRuleForm.userRoles = data.id;
+  // });
 };
 
 // 添加指纹弹窗(-----------------------------------------------)
@@ -588,17 +582,17 @@ const editClick = async (row) => {
   editRuleForm.userDepartment = row.department;
   editRuleForm.userName = row.userName;
   editRuleForm.userPhone = row.phone;
-  if (row.userMenu) {
-    editRuleForm.userRoles = row.userMenu.id;
-    nextTick(() => {
-      userRolesRef.value.setCheckedKeys([row.userMenu.id]);
-    });
-  } else {
-    editRuleForm.userRoles = "";
-    nextTick(() => {
-      userRolesRef.value.setCheckedKeys([]);
-    });
-  }
+  // if (row.userMenu) {
+  //   editRuleForm.userRoles = row.userMenu.id;
+  //   nextTick(() => {
+  //     userRolesRef.value.setCheckedKeys([row.userMenu.id]);
+  //   });
+  // } else {
+  //   editRuleForm.userRoles = "";
+  //   nextTick(() => {
+  //     userRolesRef.value.setCheckedKeys([]);
+  //   });
+  // }
 
   editRuleForm.schoolCard = row.cardNumber;
   editRuleForm.idNumber = row.idCard;
@@ -871,6 +865,7 @@ const Card = () => {
         setTimeout(() => {
           identityCardIndex.value = 3;
           identityCardTitle.value = "读卡成功";
+          addIdentityCardVisible.value = false;
         }, 1500);
       }
       editRuleForm.idNumber = data.data.uid;
@@ -984,7 +979,7 @@ const handleCurrentChange = (value) => {
 onBeforeMount(async () => {
   api.value = store.state.user.api;
   getList();
-  rolesList();
+  // rolesList();
 });
 onUnmounted(() => {
   // document.removeEventListener("keyup", Enters);

+ 108 - 61
src/views/userRoles/userRoles.vue

@@ -328,7 +328,6 @@ watch(
     }
   }
 );
-
 const currentPage = ref(1); // 当前页
 const pageSize = ref(10);
 const total = ref(); // 当前总数
@@ -343,6 +342,7 @@ const addRoles = reactive({
   adminMenuId: "",
   houseStatusManagement: [], // 房态管理
   houseTypeManagement: [], // 房型管理
+  housePriceManagement: [], // 房价管理
   houseOrderManagement: [], //订单管理
   dutyManagement: [], //值班管理
   processManagement: [], //流程管理
@@ -373,10 +373,10 @@ const addRolesData = reactive({
             { name: "退款", id: 7 },
             { name: "入住", id: 8 },
             { name: "锁房", id: 9 },
-            { name: "日志", id: 10 },
+            // { name: "日志", id: 10 },
             { name: "换房", id: 11 },
             { name: "开房", id: 12 },
-            { name: "门锁管理", id: 13 },
+            // { name: "门锁管理", id: 13 },
           ],
         },
       ],
@@ -385,7 +385,7 @@ const addRolesData = reactive({
     },
     {
       one: "房型管理",
-      two: "/",
+      two: "房型管理",
       three: [
         {
           name: "全部",
@@ -394,12 +394,26 @@ const addRolesData = reactive({
             { name: "添加", id: 1 },
             { name: "修改", id: 2 },
             { name: "删除", id: 3 },
+          ],
+        },
+      ],
+      four: "2",
+      checkedSel: [],
+    },
+    {
+      one: "房型管理",
+      two: "房价管理",
+      three: [
+        {
+          name: "全部",
+          id: 0,
+          children: [
             { name: "批量改价", id: 4 },
             { name: "改价记录", id: 5 },
           ],
         },
       ],
-      four: "2",
+      four: "3",
       checkedSel: [],
     },
     {
@@ -415,14 +429,14 @@ const addRolesData = reactive({
             { name: "入住", id: 3 },
             { name: "退款", id: 4 },
             { name: "退房", id: 5 },
-            { name: "查询", id: 6 },
-            { name: "删除", id: 7 },
+            // { name: "查询", id: 6 },
+            // { name: "删除", id: 7 },
             { name: "换房", id: 8 },
             { name: "导出", id: 9 },
           ],
         },
       ],
-      four: "3",
+      four: "4",
       checkedSel: [],
     },
     {
@@ -438,7 +452,7 @@ const addRolesData = reactive({
           ],
         },
       ],
-      four: "4",
+      four: "5",
       checkedSel: [],
     },
     {
@@ -449,17 +463,17 @@ const addRolesData = reactive({
           name: "全部",
           id: 0,
           children: [
-            { name: "添加流程", id: 1 },
-            { name: "编辑流程", id: 2 },
+            // { name: "添加流程", id: 1 },
+            // { name: "编辑流程", id: 2 },
             { name: "同意", id: 3 },
             { name: "驳回", id: 4 },
-            { name: "查询", id: 5 },
+            // { name: "查询", id: 5 },
             { name: "规则设置", id: 6 },
-            { name: "导出", id: 7 },
+            // { name: "导出", id: 7 },
           ],
         },
       ],
-      four: "5",
+      four: "6",
       checkedSel: [],
     },
     {
@@ -470,12 +484,12 @@ const addRolesData = reactive({
           name: "全部",
           id: 0,
           children: [
-            { name: "查询", id: 1 },
+            // { name: "查询", id: 1 },
             { name: "导出", id: 2 },
           ],
         },
       ],
-      four: "6",
+      four: "7",
       checkedSel: [],
     },
     {
@@ -486,24 +500,25 @@ const addRolesData = reactive({
           name: "全部",
           id: 0,
           children: [
-            { name: "添加", id: 1 },
-            { name: "编辑", id: 2 },
-            { name: "删除", id: 3 },
-            { name: "查询", id: 4 },
-            { name: "导出", id: 5 },
+            // { name: "添加", id: 1 },
+            // { name: "编辑", id: 2 },
+            // { name: "删除", id: 3 },
+            // { name: "查询", id: 4 },
+            // { name: "导出", id: 5 },
             { name: "导入", id: 6 },
-            { name: "批量重置密码", id: 7 },
-            { name: "重置密码", id: 8 },
-            { name: "添加总卡", id: 9 },
-            { name: "禁用门锁", id: 10 },
+            // { name: "批量重置密码", id: 7 },
+            // { name: "重置密码", id: 8 },
+            // { name: "添加总卡", id: 9 },
+            // { name: "禁用门锁", id: 10 },
             { name: "钥匙管理", id: 11 },
             { name: "消息列表", id: 12 },
             { name: "远程开锁", id: 13 },
             { name: "解绑设备", id: 14 },
+            { name: "NFC设置", id: 15 },
           ],
         },
       ],
-      four: "7",
+      four: "8",
       checkedSel: [],
     },
     {
@@ -514,16 +529,16 @@ const addRolesData = reactive({
           name: "全部",
           id: 0,
           children: [
-            { name: "添加", id: 1 },
-            { name: "编辑", id: 2 },
-            { name: "删除", id: 3 },
-            { name: "查询", id: 4 },
+            // { name: "添加", id: 1 },
+            // { name: "编辑", id: 2 },
+            // { name: "删除", id: 3 },
+            // { name: "查询", id: 4 },
             { name: "导出", id: 5 },
             { name: "导入", id: 6 },
           ],
         },
       ],
-      four: "8",
+      four: "9",
       checkedSel: [],
     },
     {
@@ -537,13 +552,13 @@ const addRolesData = reactive({
             { name: "添加", id: 1 },
             { name: "编辑", id: 2 },
             { name: "删除", id: 3 },
-            { name: "查询", id: 4 },
-            { name: "导出", id: 5 },
-            { name: "导入", id: 6 },
+            // { name: "查询", id: 4 },
+            // { name: "导出", id: 5 },
+            // { name: "导入", id: 6 },
           ],
         },
       ],
-      four: "9",
+      four: "10",
       checkedSel: [],
     },
     {
@@ -557,13 +572,13 @@ const addRolesData = reactive({
             { name: "添加", id: 1 },
             { name: "编辑", id: 2 },
             { name: "删除", id: 3 },
-            { name: "查询", id: 4 },
-            { name: "导出", id: 5 },
-            { name: "导入", id: 6 },
+            // { name: "查询", id: 4 },
+            // { name: "导出", id: 5 },
+            // { name: "导入", id: 6 },
           ],
         },
       ],
-      four: "10",
+      four: "11",
       checkedSel: [],
     },
     {
@@ -577,13 +592,13 @@ const addRolesData = reactive({
             { name: "添加", id: 1 },
             { name: "编辑", id: 2 },
             { name: "删除", id: 3 },
-            { name: "查询", id: 4 },
-            { name: "导出", id: 5 },
-            { name: "导入", id: 6 },
+            // { name: "查询", id: 4 },
+            // { name: "导出", id: 5 },
+            // { name: "导入", id: 6 },
           ],
         },
       ],
-      four: "11",
+      four: "12",
       checkedSel: [],
     },
     {
@@ -602,7 +617,7 @@ const addRolesData = reactive({
           ],
         },
       ],
-      four: "12",
+      four: "13",
       checkedSel: [],
     },
   ],
@@ -619,6 +634,7 @@ const addRolesData9 = ref();
 const addRolesData10 = ref();
 const addRolesData11 = ref();
 const addRolesData12 = ref();
+const addRolesData13 = ref();
 const defaultProps = ref({
   children: "children",
   label: "name",
@@ -734,38 +750,50 @@ const searchBtn = lodash.debounce(async () => {
 // 合并表格行或列
 const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
   if (columnIndex === 0) {
-    if (rowIndex === 3) {
+    if (rowIndex === 1) {
       return {
         rowspan: 2,
         colspan: 1,
       };
     }
-    if (rowIndex === 4) {
+    if (rowIndex === 2) {
       return {
         rowspan: 0,
         colspan: 0,
       };
     }
-    if (rowIndex === 6) {
+    if (rowIndex === 4) {
       return {
         rowspan: 2,
         colspan: 1,
       };
     }
-    if (rowIndex === 7) {
+    if (rowIndex === 5) {
       return {
         rowspan: 0,
         colspan: 0,
       };
     }
-    if (rowIndex === 8) {
+    if (rowIndex === 7) {
       return {
         rowspan: 2,
         colspan: 1,
       };
     }
+    if (rowIndex === 8) {
+      return {
+        rowspan: 0,
+        colspan: 0,
+      };
+    }
     if (rowIndex === 9) {
       return {
+        rowspan: 2,
+        colspan: 1,
+      };
+    }
+    if (rowIndex === 10) {
+      return {
         rowspan: 0,
         colspan: 0,
       };
@@ -815,6 +843,9 @@ const addRolesClick = () => {
   if (addRolesData12.value) {
     addRolesData12.value.setCheckedKeys([]);
   }
+  if (addRolesData13.value) {
+    addRolesData13.value.setCheckedKeys([]);
+  }
 };
 const addRolesClicks = (row) => {
   addRolesTitle.value = "添加二级角色";
@@ -857,6 +888,9 @@ const addRolesClicks = (row) => {
   }
   if (addRolesData12.value) {
     addRolesData12.value.setCheckedKeys([]);
+  } 
+  if (addRolesData13.value) {
+    addRolesData13.value.setCheckedKeys([]);
   }
 };
 const cancelAddRoles = () => {
@@ -898,51 +932,56 @@ const editClick = async (row) => {
       res.data.data.houseTypeManagement.split(",")
     );
 
+    addRoles.housePriceManagement = res.data.data.housePriceManagement.split(",");
+    addRolesData3.value.setCheckedKeys(
+      res.data.data.housePriceManagement.split(",")
+    );
+
     addRoles.houseOrderManagement =
       res.data.data.houseOrderManagement.split(",");
-    addRolesData3.value.setCheckedKeys(
+    addRolesData4.value.setCheckedKeys(
       res.data.data.houseOrderManagement.split(",")
     );
 
     addRoles.dutyManagement = res.data.data.dutyManagement.split(",");
-    addRolesData4.value.setCheckedKeys(res.data.data.dutyManagement.split(","));
+    addRolesData5.value.setCheckedKeys(res.data.data.dutyManagement.split(","));
 
     addRoles.processManagement = res.data.data.processManagement.split(",");
-    addRolesData5.value.setCheckedKeys(
+    addRolesData6.value.setCheckedKeys(
       res.data.data.processManagement.split(",")
     );
 
     addRoles.reportManagement = res.data.data.reportManagement.split(",");
-    addRolesData6.value.setCheckedKeys(
+    addRolesData7.value.setCheckedKeys(
       res.data.data.reportManagement.split(",")
     );
 
     addRoles.doorLockManagement = res.data.data.doorLockManagement.split(",");
-    addRolesData7.value.setCheckedKeys(
+    addRolesData8.value.setCheckedKeys(
       res.data.data.doorLockManagement.split(",")
     );
 
     addRoles.hydropowerManagement =
       res.data.data.hydropowerManagement.split(",");
-    addRolesData8.value.setCheckedKeys(
+    addRolesData9.value.setCheckedKeys(
       res.data.data.hydropowerManagement.split(",")
     );
 
     addRoles.userManagement = res.data.data.userManagement.split(",");
-    addRolesData9.value.setCheckedKeys(res.data.data.userManagement.split(","));
+    addRolesData10.value.setCheckedKeys(res.data.data.userManagement.split(","));
 
     addRoles.roleManagement = res.data.data.roleManagement.split(",");
-    addRolesData10.value.setCheckedKeys(
+    addRolesData11.value.setCheckedKeys(
       res.data.data.roleManagement.split(",")
     );
 
     addRoles.accountManagement = res.data.data.accountManagement.split(",");
-    addRolesData11.value.setCheckedKeys(
+    addRolesData12.value.setCheckedKeys(
       res.data.data.accountManagement.split(",")
     );
 
     addRoles.systemManagement = res.data.data.systemManagement.split(",");
-    addRolesData12.value.setCheckedKeys(
+    addRolesData13.value.setCheckedKeys(
       res.data.data.systemManagement.split(",")
     );
   } else {
@@ -964,8 +1003,10 @@ const editMemberCheckChange = (data, nodes, row) => {
   // editMemberTree.value.setCheckedKeys([]);
   if (row.one == "房态管理") {
     addRoles.houseStatusManagement = nodes.checkedKeys;
-  } else if (row.one == "房型管理") {
+  } else if (row.two == "房型管理") {
     addRoles.houseTypeManagement = nodes.checkedKeys;
+  } else if (row.two == "房价管理") {
+    addRoles.housePriceManagement = nodes.checkedKeys;
   } else if (row.one == "订单管理") {
     addRoles.houseOrderManagement = nodes.checkedKeys;
   } else if (row.two == "值班管理") {
@@ -998,6 +1039,7 @@ const confirmEdit = async () => {
       permissionSettingId: sessionStorage.getItem("permissionSettingId"),
       houseStatusManagement: addRoles.houseStatusManagement.join(","),
       houseTypeManagement: addRoles.houseTypeManagement.join(","),
+      housePriceManagement: addRoles.housePriceManagement.join(","),
       houseOrderManagement: addRoles.houseOrderManagement.join(","),
       dutyManagement: addRoles.dutyManagement.join(","),
       processManagement: addRoles.processManagement.join(","),
@@ -1009,6 +1051,8 @@ const confirmEdit = async () => {
       accountManagement: addRoles.accountManagement.join(","),
       systemManagement: addRoles.systemManagement.join(","),
     };
+    console.log(data,"编辑参数");
+    
     if (!addRoles.name) {
       ElMessage({
         type: "warning",
@@ -1028,7 +1072,9 @@ const confirmEdit = async () => {
       data: data,
     });
     if (res.data.code == 200) {
-      getList();
+      if(addRoles.id== sessionStorage.getItem('permissionSettingId')){
+        store.commit('ROLELIST',addRoles.id)
+      }
       addRolesVisible.value = false;
       ElMessage({
         type: "success",
@@ -1050,6 +1096,7 @@ const confirmEdit = async () => {
       adminMenuId: sessionStorage.getItem("permissionSettingId"),
       houseStatusManagement: addRoles.houseStatusManagement.join(","),
       houseTypeManagement: addRoles.houseTypeManagement.join(","),
+      housePriceManagement: addRoles.housePriceManagement.join(","),
       houseOrderManagement: addRoles.houseOrderManagement.join(","),
       dutyManagement: addRoles.dutyManagement.join(","),
       processManagement: addRoles.processManagement.join(","),

+ 10 - 10
vite.config.js

@@ -22,20 +22,20 @@ export default defineConfig({
     port: 8877,
     // 是否开启 https
     // https: false,
-    // proxy: {
-    //   "/hotel/ihotel/auto": {
-    //     target: "https://chtech.ncjti.edu.cn/hotel/ihotel/auto", // 测试环境
-    //     changeOrigin: true,
-    //     rewrite: (path) => path.replace(/^\/hotel\/ihotel\/auto/, ""),
-    //   },
-    // },
     proxy: {
-      "/ihotel/auto": {
-        target: "http://192.168.161.190:8090/ihotel/auto", // 测试环境
+      "/hotel/ihotel/auto": {
+        target: "https://chtech.ncjti.edu.cn/hotel/ihotel/auto", // 测试环境
         changeOrigin: true,
-        rewrite: (path) => path.replace(/^\/ihotel\/auto/, ""),
+        rewrite: (path) => path.replace(/^\/hotel\/ihotel\/auto/, ""),
       },
     },
+    // proxy: {
+    //   "/ihotel/auto": {
+    //     target: "http://192.168.161.190:8090/ihotel/auto", // 测试环境
+    //     changeOrigin: true,
+    //     rewrite: (path) => path.replace(/^\/ihotel\/auto/, ""),
+    //   },
+    // },
   },
   publicDir: "public",
   base: "./",