gqx 2 yıl önce
ebeveyn
işleme
1bb4749711

+ 210 - 12
src/views/room/fangtailive.vue

@@ -34,29 +34,47 @@
               </a-button> </a-dropdown
             ><a-button
               style="margin-bottom: 10px"
-              @click="handleAdd"
-              disabled
+              @click="handleClean"
+              :disabled="cleanDisabled"
               type="danger"
               >置干净</a-button
             ><a-button
               style="margin-bottom: 10px"
-              @click="handleAdd"
+              @click="handleDirty"
               type="danger"
-              disabled
+              :disabled="dirtyDisabled"
               >置脏</a-button
-            ><a-button
+            >
+            <a-button
+              v-if="wxCompleteBtn"
               style="margin-bottom: 10px"
-              @click="handleAdd"
-              disabled
+              @click="handleCompleteRepair"
+              type="danger"
+              >完成维修</a-button
+            >
+            <a-button
+              v-else
+              style="margin-bottom: 10px"
+              @click="handleWx"
+              :disabled="lockDisabled"
               type="danger"
               >置维修</a-button
+            >
+            <a-button
+              v-if="offLockBtn"
+              style="margin-bottom: 10px"
+              @click="handleOffLock"
+              type="danger"
+              >解锁</a-button
             ><a-button
+              v-else
               style="margin-bottom: 10px"
-              @click="handleAdd"
-              disabled
+              @click="handleLock"
+              :disabled="lockDisabled"
               type="danger"
               >锁房</a-button
-            ><a-button
+            >
+            <a-button
               disabled
               style="margin-bottom: 10px"
               @click="handleAdd"
@@ -565,7 +583,7 @@
     <template v-else-if="activeKey === '7'">
       <membergoodsmanage></membergoodsmanage>
     </template>
-    <upkeep-room-modal ref="modalForm" @ok="modalFormOk"></upkeep-room-modal>
+    <upkeep-room-modal ref="modalForm" @ok="modalWxFormOk"></upkeep-room-modal>
     <bill-room-info-modal
       ref="ModalBillRoomInfo"
       @ok="modalFormOk"
@@ -586,6 +604,14 @@
       ref="ModalEditScheduleRoom"
       @ok="modalFormOk"
     ></edit-schedule-room-modal>
+    <lock-room-modal
+      ref="ModalLockRoom"
+      @ok="modalLockRoomFormOk"
+    ></lock-room-modal>
+    <clean-room-modal
+      ref="ModalCleanRoom"
+      @ok="modalLockRoomFormOk"
+    ></clean-room-modal>
   </a-card>
 </template>
 
@@ -593,13 +619,15 @@
 import "@/assets/less/TableExpand.less";
 // import { mixinDevice } from "@/utils/mixin";
 // import { JeecgListMixin } from "@/mixins/JeecgListMixin";
-import { httpAction, getAction } from "@/api/manage";
+import { httpAction, getAction, postAction } from "@/api/manage";
 import UpkeepRoomModal from "./modules/upkeep/UpkeepRoomModal.vue";
 import BillRoomInfoModal from "./modules/checkIn/BillRoomInfoModal.vue";
 import BillRoomFormModal from "./modules/checkIn/BillRoomFormModal.vue";
 import ScheduleRoomModal from "./modules/schedule/ScheduleRoomModal.vue";
 import ScheduleTeamRoomModal from "./modules/scheduleTeam/ScheduleRoomModal.vue";
 import EditScheduleRoomModal from "./modules/schedule/EditScheduleRoomModal.vue";
+import LockRoomModal from "./modules/lock/LockRoomModal.vue";
+import CleanRoomModal from "./modules/clean/CleanRoomModal.vue";
 import calendarfangtai from "./calendarfangtai";
 import forwardfangtai from "./forwardfangtai";
 import guestorders from "./guestorders";
@@ -626,6 +654,8 @@ export default {
     leasegoods,
     membermessage,
     membergoodsmanage,
+    LockRoomModal,
+    CleanRoomModal,
   },
   data() {
     return {
@@ -705,6 +735,45 @@ export default {
       console.log("activeKey", key);
     },
   },
+  computed: {
+    lockDisabled() {
+      return !this.roomList.some((t) =>
+        t.rooms.some((c) => c.roomInfo.state === 88)
+      );
+    },
+    offLockBtn() {
+      return this.roomList.some((t) =>
+        t.rooms.some(
+          (c) => c.roomInfo.state === 88 && c.roomInfo.roomStatus === 6
+        )
+      );
+    },
+    wxCompleteBtn() {
+      return this.roomList.some((t) =>
+        t.rooms.some(
+          (c) => c.roomInfo.state === 88 && c.roomInfo.roomStatus === 5
+        )
+      );
+    },
+    cleanDisabled() {
+      return !this.roomList.some((t) =>
+        t.rooms.some(
+          (c) =>
+            c.roomInfo.state === 88 &&
+            (c.roomInfo.roomStatus === 2 || c.roomInfo.roomStatus === 4)
+        )
+      );
+    },
+    dirtyDisabled() {
+      return !this.roomList.some((t) =>
+        t.rooms.some(
+          (c) =>
+            c.roomInfo.state === 88 &&
+            (c.roomInfo.roomStatus === 1 || c.roomInfo.roomStatus === 3)
+        )
+      );
+    },
+  },
   created() {
     // 禁用右键
     // document.oncontextmenu = new Function("event.returnValue=false");
@@ -1063,6 +1132,135 @@ export default {
       this.$refs.modalForm.title = "维修";
       this.$refs.modalForm.disableSubmit = false;
     },
+    modalWxFormOk() {
+      this.loadData();
+    },
+    handleWx() {
+      var selectRoom = [];
+      this.roomList.forEach((t) => {
+        t.rooms.forEach((c) => {
+          if (c.roomInfo.state === 88) {
+            selectRoom.push({ roomId: c.roomInfo.id, roomNo: c.roomInfo.name });
+          }
+        });
+      });
+      if (selectRoom.length === 0) {
+        this.$message.warning("请先选择房间");
+        return;
+      }
+      console.log("selectRoom", selectRoom);
+      this.$refs.modalForm.add({ roomRepairList: selectRoom });
+      this.$refs.modalForm.title = "维修";
+      this.$refs.modalForm.disableSubmit = false;
+    },
+    handleLock(e) {
+      var selectRoom = [];
+      this.roomList.forEach((t) => {
+        t.rooms.forEach((c) => {
+          if (c.roomInfo.state === 88) {
+            selectRoom.push({ roomId: c.roomInfo.id, roomNo: c.roomInfo.name });
+          }
+        });
+      });
+      if (selectRoom.length === 0) {
+        this.$message.warning("请先选择房间");
+        return;
+      }
+      console.log("selectRoom", selectRoom);
+      this.$refs.ModalLockRoom.add({ roomLockList: selectRoom });
+      this.$refs.ModalLockRoom.title = "锁房";
+      this.$refs.ModalLockRoom.disableSubmit = false;
+    },
+    handleDirty() {
+      var selectRoom = [];
+      this.roomList.forEach((t) => {
+        t.rooms.forEach((c) => {
+          if (c.roomInfo.state === 88) {
+            selectRoom.push(c.roomInfo.id);
+          }
+        });
+      });
+      if (selectRoom.length === 0) {
+        this.$message.warning("请先选择房间");
+        return;
+      }
+      var ids = selectRoom.join(",");
+      postAction("/rooms/cesRooms/dirtyRoom?roomIds=" + ids, {}).then(
+        (res) => {
+          if (res.success) {
+            this.$message.success(res.message);
+            this.loadData();
+          }
+        }
+      );
+    },
+    handleClean(e) {
+      var selectRoom = [];
+      this.roomList.forEach((t) => {
+        t.rooms.forEach((c) => {
+          if (c.roomInfo.state === 88) {
+            selectRoom.push({ roomId: c.roomInfo.id, roomNo: c.roomInfo.name });
+          }
+        });
+      });
+      if (selectRoom.length === 0) {
+        this.$message.warning("请先选择房间");
+        return;
+      }
+      console.log("selectRoom", selectRoom);
+      this.$refs.ModalCleanRoom.add({ roomCleanList: selectRoom });
+      this.$refs.ModalCleanRoom.title = "清理房间";
+      this.$refs.ModalCleanRoom.disableSubmit = false;
+    },
+    handleOffLock() {
+      var selectRoom = [];
+      this.roomList.forEach((t) => {
+        t.rooms.forEach((c) => {
+          if (c.roomInfo.state === 88) {
+            selectRoom.push(c.roomInfo.id);
+          }
+        });
+      });
+      if (selectRoom.length === 0) {
+        this.$message.warning("请先选择房间");
+        return;
+      }
+      var ids = selectRoom.join(",");
+      postAction("/fw/fwRoomLock/offLockRoom?roomIds=" + ids, {}).then(
+        (res) => {
+          if (res.success) {
+            this.$message.success(res.message);
+            this.loadData();
+          }
+        }
+      );
+    },
+    handleCompleteRepair() {
+      var selectRoom = [];
+      this.roomList.forEach((t) => {
+        t.rooms.forEach((c) => {
+          if (c.roomInfo.state === 88) {
+            selectRoom.push(c.roomInfo.id);
+          }
+        });
+      });
+      if (selectRoom.length === 0) {
+        this.$message.warning("请先选择房间");
+        return;
+      }
+      var ids = selectRoom.join(",");
+      postAction("/fw/fwRoomRepair/completeRepairRoom?roomIds=" + ids, {}).then(
+        (res) => {
+          if (res.success) {
+            this.$message.success(res.message);
+            this.loadData();
+          }
+        }
+      );
+    },
+    modalLockRoomFormOk() {
+      this.loadData();
+    },
     onMenuClick(e, row) {
       console.log("e", e);
       console.log("row", row);

+ 153 - 0
src/views/room/modules/clean/CleanRoomForm.vue

@@ -0,0 +1,153 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="服务员"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="waiterId"
+            >
+              <a-select placeholder="服务员" v-model="model.waiterId">
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in busWaiterList"
+                  :key="item.id"
+                >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="备注"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="remark"
+            >
+              <a-textarea
+                v-model="model.remark"
+                rows="4"
+                placeholder="请输入备注"
+              />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMeetingRoomForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        waiterId: [{ required: true, message: "请选择服务员!" }],
+      },
+      url: {
+        add: "/fw/fwRoomClean/add",
+        edit: "/fw/fwRoomClean/edit",
+        queryById: "/fw/fwRoomClean/queryById",
+      },
+      busWaiterList:[]
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    getAction("/business/busWaiter/list", {
+      hotelId: _info.id,
+      pageNo: 1,
+      pageSize: 99999,
+    }).then((res) => {
+      if (res.success) {
+        this.busWaiterList = res.result.records;
+      }
+    });
+  },
+  methods: {
+    onChange(date, dateString) {
+      console.log(date, dateString);
+    },
+    add(record) {
+      this.modelDefault = Object.assign(this.modelDefault, record);
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          let httpurl = "";
+          let method = "";
+          if (!this.model.id) {
+            httpurl += this.url.add;
+            method = "post";
+          } else {
+            httpurl += this.url.edit;
+            method = "put";
+          }
+          httpAction(httpurl, this.model, method)
+            .then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/clean/CleanRoomModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <upkeep-room-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></upkeep-room-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import UpkeepRoomForm from './CleanRoomForm'
+  export default {
+    name: 'UpkeepRoomFormModal',
+    components: {
+      UpkeepRoomForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(record);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 125 - 0
src/views/room/modules/lock/LockRoomForm.vue

@@ -0,0 +1,125 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="锁房原因"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="remark"
+            >
+              <a-textarea
+                v-model="model.remark"
+                rows="4"
+                placeholder="请输入锁房原因"
+              />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusMeetingRoomForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        remark: [{ required: true, message: "请输入锁房原因!" }],
+      },
+      url: {
+        add: "/fw/fwRoomLock/add",
+        edit: "/fw/fwRoomLock/edit",
+        queryById: "/fw/fwRoomLock/queryById",
+      },
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+  },
+  methods: {
+    onChange(date, dateString) {
+      console.log(date, dateString);
+    },
+    add(record) {
+      this.modelDefault = Object.assign(this.modelDefault, record);
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          let httpurl = "";
+          let method = "";
+          if (!this.model.id) {
+            httpurl += this.url.add;
+            method = "post";
+          } else {
+            httpurl += this.url.edit;
+            method = "put";
+          }
+          httpAction(httpurl, this.model, method)
+            .then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 60 - 0
src/views/room/modules/lock/LockRoomModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <upkeep-room-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></upkeep-room-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import UpkeepRoomForm from './LockRoomForm'
+  export default {
+    name: 'UpkeepRoomFormModal',
+    components: {
+      UpkeepRoomForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(record);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 21 - 10
src/views/room/modules/upkeep/UpkeepRoomForm.vue

@@ -41,7 +41,13 @@
 <script>
 import { httpAction, getAction } from "@/api/manage";
 import { validateDuplicateValue } from "@/utils/util";
-
+import moment from "moment";
+const date = new Date();
+const endDate = new Date(date.setDate(date.getDate() + 1));
+const dateRange = [
+  moment(new Date(), "YYYY-MM-DD"),
+  moment(endDate, "YYYY-MM-DD"),
+];
 export default {
   name: "BusMeetingRoomForm",
   components: {},
@@ -55,7 +61,11 @@ export default {
   },
   data() {
     return {
-      model: {},
+      model: {
+        dateRange: dateRange,
+        startDate: moment(dateRange[0]).format("YYYY-MM-DD"),
+        endDate: moment(dateRange[1]).format("YYYY-MM-DD"),
+      },
       labelCol: {
         xs: { span: 24 },
         sm: { span: 5 },
@@ -70,9 +80,9 @@ export default {
         remark: [{ required: true, message: "请输入维修原因!" }],
       },
       url: {
-        add: "/business/busMeetingRoom/add",
-        edit: "/business/busMeetingRoom/edit",
-        queryById: "/business/busMeetingRoom/queryById",
+        add: "/fw/fwRoomRepair/add",
+        edit: "/fw/fwRoomRepair/edit",
+        queryById: "/fw/fwRoomRepair/queryById",
       },
     };
   },
@@ -90,10 +100,13 @@ export default {
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
   },
   methods: {
-    onChange(date, dateString) {
-      console.log(date, dateString);
+    moment,
+    onChange(e, dateString) {
+      this.model.startDate = dateString[0];
+      this.model.endDate = dateString[1];
     },
-    add() {
+    add(record) {
+      this.modelDefault = Object.assign(this.modelDefault, record);
       this.edit(this.modelDefault);
     },
     edit(record) {
@@ -102,8 +115,6 @@ export default {
     },
     submitForm() {
       const that = this;
-      that.$message.warning('未实现');
-      return;
       // 触发表单验证
       this.$refs.form.validate((valid) => {
         if (valid) {

+ 2 - 2
src/views/room/modules/upkeep/UpkeepRoomModal.vue

@@ -29,10 +29,10 @@
       }
     },
     methods: {
-      add () {
+      add (record) {
         this.visible=true
         this.$nextTick(()=>{
-          this.$refs.realForm.add();
+          this.$refs.realForm.add(record);
         })
       },
       edit (record) {