Browse Source

no message

hzj18279462576@163.com 3 years ago
parent
commit
41cf102090
3 changed files with 281 additions and 96 deletions
  1. 1 1
      admin/src/api/roomThirdSetting.js
  2. 272 91
      admin/src/views/home/index.vue
  3. 8 4
      admin/src/views/inform/index.vue

+ 1 - 1
admin/src/api/roomThirdSetting.js

@@ -12,6 +12,6 @@ export function changeElectric(roomId, operType) {
 }
 }
 
 
 // 修改房间第三方平台设置
 // 修改房间第三方平台设置
-export function Updata(params) {
+export function Update(params) {
     return http.post(`${resquest}/update`, params)
     return http.post(`${resquest}/update`, params)
 }
 }

+ 272 - 91
admin/src/views/home/index.vue

@@ -13,7 +13,7 @@
         >
         >
         </el-input>
         </el-input>
         <el-button class="inquire-button">查询</el-button>
         <el-button class="inquire-button">查询</el-button>
-        <div class="control">
+        <!-- <div class="control">
           <div class="title" @click="water = !water" style="cursor: pointer">
           <div class="title" @click="water = !water" style="cursor: pointer">
             批量控制电
             批量控制电
           </div>
           </div>
@@ -45,7 +45,7 @@
               </span>
               </span>
             </el-dialog>
             </el-dialog>
           </ul>
           </ul>
-        </div>
+        </div> -->
         <div class="control" style="margin-left: 17px">
         <div class="control" style="margin-left: 17px">
           <div class="title" @click="room = !room" style="cursor: pointer">
           <div class="title" @click="room = !room" style="cursor: pointer">
             批量开关房
             批量开关房
@@ -108,7 +108,7 @@
                 </ul>
                 </ul>
               </div>
               </div>
               <span slot="footer" class="dialog-footer">
               <span slot="footer" class="dialog-footer">
-                <el-button @click="dialogVisible = false">取 消</el-button>
+                <el-button @click="cancel">取 消</el-button>
                 <el-button type="primary" @click="PLcloseRoom">确 定</el-button>
                 <el-button type="primary" @click="PLcloseRoom">确 定</el-button>
               </span>
               </span>
             </el-dialog>
             </el-dialog>
@@ -132,7 +132,10 @@
                   popper-class="popperOptions"
                   popper-class="popperOptions"
                 >
                 >
                   <div class="control-room">
                   <div class="control-room">
-                    <el-button size="mini" @click="closeRoom(item)"
+                    <el-button
+                      size="mini"
+                      @click="closeRoom(item)"
+                      :disabled="item.statu != 1"
                       >关房</el-button
                       >关房</el-button
                     >
                     >
                     <el-button size="mini" @click="todirty(item)"
                     <el-button size="mini" @click="todirty(item)"
@@ -140,7 +143,7 @@
                     >
                     >
                     <el-button
                     <el-button
                       size="mini"
                       size="mini"
-                      :disabled="item.statuName != '脏房'"
+                      :disabled="item.statu != 4 && item.statu != 5"
                       @click="leisure(item)"
                       @click="leisure(item)"
                       >转空闲</el-button
                       >转空闲</el-button
                     >
                     >
@@ -177,7 +180,7 @@
                       </div>
                       </div>
                       <div class="count-down">
                       <div class="count-down">
                         <span>退房倒计时 {{ item.EndTime }}</span>
                         <span>退房倒计时 {{ item.EndTime }}</span>
-                        <div class="tuifang" @click.stop="roomLock(item)">
+                        <!-- <div class="tuifang" @click.stop="roomLock(item)">
                           <IconSvg :W="21" :H="21" name="tuifang" />
                           <IconSvg :W="21" :H="21" name="tuifang" />
                           <el-dialog
                           <el-dialog
                             title="门锁管理"
                             title="门锁管理"
@@ -296,11 +299,118 @@
                               >
                               >
                             </span>
                             </span>
                           </el-dialog>
                           </el-dialog>
-                        </div>
+                        </div> -->
                       </div>
                       </div>
                     </template>
                     </template>
                   </div>
                   </div>
                 </el-popover>
                 </el-popover>
+                <div class="tuifang" @click.stop="roomLock(item)">
+                  <IconSvg :W="21" :H="21" name="tuifang" />
+                  <el-dialog
+                    title="门锁管理"
+                    custom-class="lock"
+                    :append-to-body="true"
+                    :visible.sync="doorLock"
+                    width="30%"
+                    :before-close="lockClose"
+                  >
+                    <div class="roomID" style="margin-top: 13px">
+                      <div class="roomblock">
+                        <span>门锁ID:</span>
+                        <div class="number" v-if="doorLockList.doorIdshow">
+                          <span>{{ doorLockList.doorId }}</span>
+                          <div @click="editlock">
+                            <IconSvg :W="16" :H="16" name="edit" />
+                          </div>
+                        </div>
+                        <el-input
+                          ref="roomId"
+                          v-else
+                          size="mini"
+                          v-model="doorLockList.doorId"
+                          @blur="editLockInput"
+                        ></el-input>
+                      </div>
+                      <div class="roomblock">
+                        <span>水表编码:</span>
+                        <div class="number" v-if="doorLockList.waterIdshow">
+                          <span>{{ doorLockList.waterId }}</span>
+                          <div @click="editWater">
+                            <IconSvg :W="16" :H="16" name="edit" />
+                          </div>
+                        </div>
+                        <el-input
+                          v-else
+                          size="mini"
+                          v-model="doorLockList.waterId"
+                          @blur="editWaterInput"
+                        ></el-input>
+                      </div>
+                    </div>
+                    <div class="roomID">
+                      <div class="roomblock">
+                        <span>门锁序列号:</span>
+                        <div class="number" v-if="doorLockList.doorNumshow">
+                          <span>{{ doorLockList.doorNum }}</span>
+                          <div @click="editRoomNum">
+                            <IconSvg :W="16" :H="16" name="edit" />
+                          </div>
+                        </div>
+                        <el-input
+                          v-else
+                          size="mini"
+                          v-model="doorLockList.doorNum"
+                          @blur="editRoomNumInput"
+                        ></el-input>
+                      </div>
+                      <div class="roomblock">
+                        <span>电表编码:</span>
+                        <div
+                          class="number"
+                          v-if="doorLockList.electricityIdshow"
+                        >
+                          <span>{{ doorLockList.electricityId }}</span>
+                          <div @click="editEle">
+                            <IconSvg :W="16" :H="16" name="edit" />
+                          </div>
+                        </div>
+                        <el-input
+                          v-else
+                          size="mini"
+                          v-model="doorLockList.electricityId"
+                          @blur="editEleInput"
+                        ></el-input>
+                      </div>
+                    </div>
+                    <div class="roomID">
+                      <div class="roompassword">
+                        <span>门锁密码:</span>
+                        <div
+                          class="sendpass"
+                          v-for="item in roomPassWord"
+                          :key="item.id"
+                        >
+                          <span>{{ item.lockRealtimePassword }}</span>
+                          <span class="password" @click="sending(item)"
+                            >下发密码</span
+                          >
+                          <span style="margin-left: 10px"
+                            >密码到期时间 :
+                            {{ item.endTime.replace("T", " ") }}</span
+                          >
+                        </div>
+                      </div>
+                    </div>
+                    <span slot="footer" class="dialog-footer">
+                      <el-button @click.stop="doorLock = false" size="mini"
+                        >取消</el-button
+                      >
+                      <el-button size="mini" @click.stop="UpdataRoom(item)"
+                        >完成</el-button
+                      >
+                    </span>
+                  </el-dialog>
+                </div>
               </div>
               </div>
             </div>
             </div>
           </div>
           </div>
@@ -376,6 +486,8 @@ export default {
       // 门锁管理
       // 门锁管理
       doorLock: false,
       doorLock: false,
       doorLockList: {
       doorLockList: {
+        id: "",
+        roomId: "",
         doorId: "",
         doorId: "",
         doorIdshow: true,
         doorIdshow: true,
         waterId: "",
         waterId: "",
@@ -633,7 +745,7 @@ export default {
                     id: i.roomId,
                     id: i.roomId,
                     label: i.build + "栋" + i.roomno,
                     label: i.build + "栋" + i.roomno,
                   };
                   };
-                  if (i.statu != 5) {
+                  if (i.statu == 1) {
                     this.data[0].children.push(arr);
                     this.data[0].children.push(arr);
                   }
                   }
                 }
                 }
@@ -765,17 +877,28 @@ export default {
               });
               });
           })
           })
           .catch((_) => {});
           .catch((_) => {});
+      } else if (this.title == "批量开房") {
+        console.log("开房");
       }
       }
     },
     },
     // 批量开关房end
     // 批量开关房end
 
 
     //脏房转空闲
     //脏房转空闲
     leisure(item) {
     leisure(item) {
-      this.API.roomRealTimeStatu
-        .clean(item.statuId)
-        .then((res) => console.log(res));
-      console.log(item);
-      this.roomList(this.Data);
+      console.log(item.statu != 4 || item.statu != 5);
+      this.API.roomRealTimeStatu.clean(item.statuId).then((res) => {
+        console.log(res);
+        console.log(item);
+        if (res.success) {
+          this.roomList(this.Data);
+          this.$message({
+            message: "成功转为空闲房",
+            type: "success",
+          });
+        } else {
+          this.$message.error(res.message);
+        }
+      });
     },
     },
 
 
     // 锁定房间
     // 锁定房间
@@ -791,7 +914,15 @@ export default {
         .lock({ roomId, startDate, endDate, remark })
         .lock({ roomId, startDate, endDate, remark })
         .then((res) => {
         .then((res) => {
           console.log(res);
           console.log(res);
-          this.roomList(this.Data);
+          if (res.success) {
+            this.roomList(this.Data);
+            this.$message({
+              message: "关房成功",
+              type: "success",
+            });
+          } else {
+            this.$message.error(res.message);
+          }
         });
         });
     },
     },
     // 转脏房
     // 转脏房
@@ -806,7 +937,15 @@ export default {
         .toDirty({ roomId, startDay, endDay })
         .toDirty({ roomId, startDay, endDay })
         .then((res) => {
         .then((res) => {
           console.log(res);
           console.log(res);
-          this.roomList(this.Data);
+          if (res.success) {
+            this.roomList(this.Data);
+            this.$message({
+              message: "成功转为脏房",
+              type: "success",
+            });
+          } else {
+            this.$message.error(res.message);
+          }
         });
         });
     },
     },
     // 关电
     // 关电
@@ -814,16 +953,24 @@ export default {
       console.log(item);
       console.log(item);
       let operType = "2";
       let operType = "2";
       let roomId = item.roomId;
       let roomId = item.roomId;
-      this.API.roomThirdSetting.changeElectric(roomId, operType).then((res) => {
-        console.log(res);
-        if (res.success) {
-          this.$message({
-            message: "关电成功",
-            type: "success",
-          });
-          this.roomList(this.Data);
-        }
-      });
+      this.$confirm(`确认关电吗?`)
+        .then((_) => {
+          this.API.roomThirdSetting
+            .changeElectric(roomId, operType)
+            .then((res) => {
+              console.log(res);
+              if (res.success) {
+                this.$message({
+                  message: "关电成功",
+                  type: "success",
+                });
+                this.roomList(this.Data);
+              } else {
+                this.$message.error(res.message);
+              }
+            });
+        })
+        .catch((_) => {});
     },
     },
 
 
     // 房态筛查
     // 房态筛查
@@ -857,70 +1004,101 @@ export default {
         .then((_) => {
         .then((_) => {
           this.API.doorLock.sendPassword(item.id).then((res) => {
           this.API.doorLock.sendPassword(item.id).then((res) => {
             console.log(res);
             console.log(res);
-            this.$message({
-              message: "下发密码成功",
-              type: "success",
-            });
-            this.doorLock = false;
+            if (res.success) {
+              this.$message({
+                message: "下发密码成功",
+                type: "success",
+              });
+              this.doorLock = false;
+            } else {
+              this.$message.error(res.message);
+            }
           });
           });
         })
         })
         .catch((_) => {});
         .catch((_) => {});
     },
     },
     roomLock(item) {
     roomLock(item) {
-      this.doorLock = true;
       console.log(item);
       console.log(item);
+      this.doorLock = true;
       // 房间id查询密码锁
       // 房间id查询密码锁
       this.API.doorLock.roomDoorLockRoomId(item.roomId).then((res) => {
       this.API.doorLock.roomDoorLockRoomId(item.roomId).then((res) => {
-        console.log(res.data);
-
+        console.log(res);
         this.roomPassWord = res.data;
         this.roomPassWord = res.data;
       });
       });
       // 根据房间id查询(拿到电表码,水表码)
       // 根据房间id查询(拿到电表码,水表码)
       this.API.roomThirdSetting.settingId(item.roomId).then((res) => {
       this.API.roomThirdSetting.settingId(item.roomId).then((res) => {
         console.log(res.data);
         console.log(res.data);
+        this.doorLockList.id = item.id;
+        this.doorLockList.roomId = item.roomId;
         this.doorLockList.electricityId = res.data.electricId;
         this.doorLockList.electricityId = res.data.electricId;
         this.doorLockList.waterId = res.data.waterId;
         this.doorLockList.waterId = res.data.waterId;
         this.doorLockList.doorId = res.data.lockId;
         this.doorLockList.doorId = res.data.lockId;
       });
       });
-      // 订单Id查询密码锁
-      this.API.doorLock
-        .roomDoorLockOrderId(item.useInfo.orderId)
-        .then((res) => {
-          console.log(res);
-        });
     },
     },
+
     // 编辑门锁ID
     // 编辑门锁ID
     editlock() {
     editlock() {
       this.doorLockList.doorIdshow = false;
       this.doorLockList.doorIdshow = false;
     },
     },
-    editLockBlur() {
+    editLockInput() {
       this.doorLockList.doorIdshow = true;
       this.doorLockList.doorIdshow = true;
       console.log(111);
       console.log(111);
     },
     },
+
     // 门锁序列号
     // 门锁序列号
     editRoomNum() {
     editRoomNum() {
       this.doorLockList.doorNumshow = false;
       this.doorLockList.doorNumshow = false;
     },
     },
-    editRoomNumBlur() {
+    editRoomNumInput() {
       this.doorLockList.doorNumshow = true;
       this.doorLockList.doorNumshow = true;
       console.log(111);
       console.log(111);
     },
     },
+
     // 编辑水表编码
     // 编辑水表编码
     editWater() {
     editWater() {
       this.doorLockList.waterIdshow = false;
       this.doorLockList.waterIdshow = false;
     },
     },
-    editWaterBlur() {
+    editWaterInput() {
       this.doorLockList.waterIdshow = true;
       this.doorLockList.waterIdshow = true;
       console.log(111);
       console.log(111);
     },
     },
+
     // 编辑电表编码
     // 编辑电表编码
     editEle() {
     editEle() {
       this.doorLockList.electricityIdshow = false;
       this.doorLockList.electricityIdshow = false;
     },
     },
-    editEleBlur() {
+    editEleInput() {
       this.doorLockList.electricityIdshow = true;
       this.doorLockList.electricityIdshow = true;
       console.log(111);
       console.log(111);
     },
     },
+
+    // 修改房间水表码、电表码、锁id
+    UpdataRoom(item) {
+      console.log(item);
+      this.doorLock = false;
+      console.log(this.doorLockList);
+      let arr = {
+        id: this.doorLockList.id,
+        roomId: this.doorLockList.roomId,
+        waterId: this.doorLockList.waterId,
+        electricId: this.doorLockList.electricityId,
+        lockId: this.doorLockList.doorId,
+      };
+      console.log(arr);
+      this.API.roomThirdSetting.Update(arr).then((res) => {
+        if (res.success) {
+          console.log(res);
+        } else {
+          console.log(res);
+          this.$message.error(res.message);
+        }
+      });
+    },
+
+    // 取消修改房间水表码、电表码、锁id
+    cancel() {
+      this.dialogVisible = false;
+    },
   },
   },
 };
 };
 </script>
 </script>
@@ -962,7 +1140,7 @@ export default {
       height: 37px;
       height: 37px;
       background: rgba(240, 243, 247, 1);
       background: rgba(240, 243, 247, 1);
       border-radius: 5px;
       border-radius: 5px;
-      margin-left: 744px;
+      margin-left: 897px;
 
 
       /deep/ .el-input__inner {
       /deep/ .el-input__inner {
         height: 37px !important;
         height: 37px !important;
@@ -1056,7 +1234,56 @@ export default {
           flex-wrap: wrap;
           flex-wrap: wrap;
           .room-num {
           .room-num {
             margin-bottom: 30px;
             margin-bottom: 30px;
-
+            position: relative;
+            .tuifang {
+              position: absolute;
+              right: 35px;
+              top: 100px;
+              width: 21px;
+              height: 21px;
+              cursor: pointer;
+              .el-dialog {
+                box-shadow: none;
+                margin: 350px 0 0 450px !important;
+                width: 555px !important;
+                height: 377px !important;
+                .text {
+                  display: flex;
+                  margin-left: 34px;
+                  margin-bottom: 15px;
+                  font-size: 14px;
+                  font-weight: 400;
+                  span {
+                    margin-right: 20px;
+                  }
+                  .password {
+                    color: #fff;
+                    border-radius: 2px;
+                    font-size: 12px;
+                    padding: 2px;
+                    cursor: pointer;
+                    background-color: rgba(41, 109, 227, 1);
+                  }
+                }
+                .el-dialog__body {
+                  flex-direction: column;
+                }
+                .el-dialog__footer {
+                  margin: 40px -48px 0 0;
+                  .dialog-footer {
+                    .el-button:nth-child(2) {
+                      color: #fff;
+                      background: rgba(41, 109, 227, 1);
+                    }
+                    .el-button {
+                      width: 67px;
+                      height: 37px;
+                      padding-left: 20px;
+                    }
+                  }
+                }
+              }
+            }
             .card {
             .card {
               width: 228px;
               width: 228px;
               height: 140px;
               height: 140px;
@@ -1114,52 +1341,6 @@ export default {
                 span {
                 span {
                   margin-right: 54px;
                   margin-right: 54px;
                 }
                 }
-                .tuifang {
-                  width: 21px;
-                  height: 21px;
-                  cursor: pointer;
-                  .el-dialog {
-                    box-shadow: none;
-                    margin: 350px 0 0 450px !important;
-                    width: 555px !important;
-                    height: 377px !important;
-                    .text {
-                      display: flex;
-                      margin-left: 34px;
-                      margin-bottom: 15px;
-                      font-size: 14px;
-                      font-weight: 400;
-                      span {
-                        margin-right: 20px;
-                      }
-                      .password {
-                        color: #fff;
-                        border-radius: 2px;
-                        font-size: 12px;
-                        padding: 2px;
-                        cursor: pointer;
-                        background-color: rgba(41, 109, 227, 1);
-                      }
-                    }
-                    .el-dialog__body {
-                      flex-direction: column;
-                    }
-                    .el-dialog__footer {
-                      margin: 40px -48px 0 0;
-                      .dialog-footer {
-                        .el-button:nth-child(2) {
-                          color: #fff;
-                          background: rgba(41, 109, 227, 1);
-                        }
-                        .el-button {
-                          width: 67px;
-                          height: 37px;
-                          padding-left: 20px;
-                        }
-                      }
-                    }
-                  }
-                }
               }
               }
             }
             }
             .cardId {
             .cardId {

+ 8 - 4
admin/src/views/inform/index.vue

@@ -249,10 +249,14 @@ export default {
     handleDelete(index, row) {
     handleDelete(index, row) {
       let ids = [row.id];
       let ids = [row.id];
       console.log(ids);
       console.log(ids);
-      this.API.systemnotice.systemnoticeDelete(ids).then((res) => {
-        console.log(res);
-      });
-      this.dataList();
+      this.$confirm("确认删除通知?")
+        .then((_) => {
+          this.API.systemnotice.systemnoticeDelete(ids).then((res) => {
+            console.log(res);
+          });
+          this.dataList();
+        })
+        .catch((_) => {});
     },
     },
   },
   },
 };
 };