diff --git a/src/views/ofm/booking_form.vue b/src/views/ofm/booking_form.vue
index 5431b353..4624e470 100644
--- a/src/views/ofm/booking_form.vue
+++ b/src/views/ofm/booking_form.vue
@@ -37,7 +37,7 @@
-
+
@@ -45,7 +45,7 @@
-
+
+
+
+
+
{{ item.label }}
+
{{ item.label }}
+
{{ item.label }}
+
@@ -127,54 +134,54 @@ export default {
title: [{ required: true, message: "请输入容纳人数", trigger: "blur" }],
},
timesList:[
- {value:0,label:'00:00-00:30',isSelect:false},
- {value:1,label:'00:30-01:00',isSelect:false},
- {value:2,label:'01:00-01:30',isSelect:false},
- {value:3,label:'01:30-02:00',isSelect:false},
- {value:4,label:'02:00-02:30',isSelect:false},
- {value:5,label:'02:30-03:00',isSelect:false},
- {value:6,label:'03:00-03:30',isSelect:false},
- {value:7,label:'03:30-04:00',isSelect:false},
- {value:8,label:'04:00-04:30',isSelect:false},
- {value:9,label:'04:30-05:00',isSelect:false},
- {value:10,label:'05:00-05:30',isSelect:false},
- {value:11,label:'05:30-06:00',isSelect:false},
- {value:12,label:'06:00-06:30',isSelect:false},
- {value:13,label:'06:30-07:00',isSelect:false},
- {value:14,label:'07:00-07:30',isSelect:false},
- {value:15,label:'07:30-08:00',isSelect:false},
- {value:16,label:'08:00-08:30',isSelect:false},
- {value:17,label:'08:30-09:00',isSelect:false},
- {value:18,label:'09:00-09:30',isSelect:false},
- {value:19,label:'09:30-10:00',isSelect:false},
- {value:20,label:'10:00-10:30',isSelect:false},
- {value:21,label:'10:30-11:00',isSelect:false},
- {value:22,label:'11:00-11:30',isSelect:false},
- {value:23,label:'11:30-12:00',isSelect:false},
- {value:24,label:'12:00-12:30',isSelect:false},
- {value:25,label:'12:30-13:00',isSelect:false},
- {value:26,label:'13:00-13:30',isSelect:false},
- {value:27,label:'13:30-14:00',isSelect:false},
- {value:28,label:'14:00-14:30',isSelect:false},
- {value:29,label:'14:30-15:00',isSelect:false},
- {value:30,label:'15:00-15:30',isSelect:false},
- {value:31,label:'15:30-16:00',isSelect:false},
- {value:32,label:'16:00-16:30',isSelect:false},
- {value:33,label:'16:30-17:00',isSelect:false},
- {value:34,label:'17:00-17:30',isSelect:false},
- {value:35,label:'17:30-18:00',isSelect:false},
- {value:36,label:'18:00-18:30',isSelect:false},
- {value:37,label:'18:30-19:00',isSelect:false},
- {value:38,label:'19:00-19:30',isSelect:false},
- {value:39,label:'19:30-20:00',isSelect:false},
- {value:40,label:'20:00-20:30',isSelect:false},
- {value:41,label:'20:30-21:00',isSelect:false},
- {value:42,label:'21:00-21:30',isSelect:false},
- {value:43,label:'21:30-22:00',isSelect:false},
- {value:44,label:'22:00-22:30',isSelect:false},
- {value:45,label:'22:30-23:00',isSelect:false},
- {value:46,label:'23:00-23:30',isSelect:false},
- {value:47,label:'23:30-24:00',isSelect:false}
+ {value:0,label:'00:00-00:30',isSelect:false,sloted:false},
+ {value:1,label:'00:30-01:00',isSelect:false,sloted:false},
+ {value:2,label:'01:00-01:30',isSelect:false,sloted:false},
+ {value:3,label:'01:30-02:00',isSelect:false,sloted:false},
+ {value:4,label:'02:00-02:30',isSelect:false,sloted:false},
+ {value:5,label:'02:30-03:00',isSelect:false,sloted:false},
+ {value:6,label:'03:00-03:30',isSelect:false,sloted:false},
+ {value:7,label:'03:30-04:00',isSelect:false,sloted:false},
+ {value:8,label:'04:00-04:30',isSelect:false,sloted:false},
+ {value:9,label:'04:30-05:00',isSelect:false,sloted:false},
+ {value:10,label:'05:00-05:30',isSelect:false,sloted:false},
+ {value:11,label:'05:30-06:00',isSelect:false,sloted:false},
+ {value:12,label:'06:00-06:30',isSelect:false,sloted:false},
+ {value:13,label:'06:30-07:00',isSelect:false,sloted:false},
+ {value:14,label:'07:00-07:30',isSelect:false,sloted:false},
+ {value:15,label:'07:30-08:00',isSelect:false,sloted:false},
+ {value:16,label:'08:00-08:30',isSelect:false,sloted:false},
+ {value:17,label:'08:30-09:00',isSelect:false,sloted:false},
+ {value:18,label:'09:00-09:30',isSelect:false,sloted:false},
+ {value:19,label:'09:30-10:00',isSelect:false,sloted:false},
+ {value:20,label:'10:00-10:30',isSelect:false,sloted:false},
+ {value:21,label:'10:30-11:00',isSelect:false,sloted:false},
+ {value:22,label:'11:00-11:30',isSelect:false,sloted:false},
+ {value:23,label:'11:30-12:00',isSelect:false,sloted:false},
+ {value:24,label:'12:00-12:30',isSelect:false,sloted:false},
+ {value:25,label:'12:30-13:00',isSelect:false,sloted:false},
+ {value:26,label:'13:00-13:30',isSelect:false,sloted:false},
+ {value:27,label:'13:30-14:00',isSelect:false,sloted:false},
+ {value:28,label:'14:00-14:30',isSelect:false,sloted:false},
+ {value:29,label:'14:30-15:00',isSelect:false,sloted:false},
+ {value:30,label:'15:00-15:30',isSelect:false,sloted:false},
+ {value:31,label:'15:30-16:00',isSelect:false,sloted:false},
+ {value:32,label:'16:00-16:30',isSelect:false,sloted:false},
+ {value:33,label:'16:30-17:00',isSelect:false,sloted:false},
+ {value:34,label:'17:00-17:30',isSelect:false,sloted:false},
+ {value:35,label:'17:30-18:00',isSelect:false,sloted:false},
+ {value:36,label:'18:00-18:30',isSelect:false,sloted:false},
+ {value:37,label:'18:30-19:00',isSelect:false,sloted:false},
+ {value:38,label:'19:00-19:30',isSelect:false,sloted:false},
+ {value:39,label:'19:30-20:00',isSelect:false,sloted:false},
+ {value:40,label:'20:00-20:30',isSelect:false,sloted:false},
+ {value:41,label:'20:30-21:00',isSelect:false,sloted:false},
+ {value:42,label:'21:00-21:30',isSelect:false,sloted:false},
+ {value:43,label:'21:30-22:00',isSelect:false,sloted:false},
+ {value:44,label:'22:00-22:30',isSelect:false,sloted:false},
+ {value:45,label:'22:30-23:00',isSelect:false,sloted:false},
+ {value:46,label:'23:00-23:30',isSelect:false,sloted:false},
+ {value:47,label:'23:30-24:00',isSelect:false,sloted:false}
],
mRoomList: [],
timeselectList: [],
@@ -183,7 +190,8 @@ export default {
mounted() {
let that = this;
that.getmRoomList();
- if (that.t_id){
+ console.log("that.editId",that.editId);
+ if (that.editId){
that.getTid();
}
else {
@@ -205,24 +213,48 @@ export default {
},
getTid (){
var that = this;
- if (that.t_id) {
- that.$API.ofm.mroombooking.item.req(that.t_id).then(res=>{
+ if (that.editId) {
+ that.handleEidt(that.editId);
+ that.$API.ofm.mroombooking.item.req(that.editId).then(res=>{
that.form = res;
- if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) {
- that.handleEidt(that.t_id);
- that.$emit("changeMode", "edit");
- }else{
- that.$emit("changeMode", "show");
- }
+ if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) {
+ that.$emit("changeMode", "edit");
+ }else{
+ that.$emit("changeMode", "show");
+ }
})
}
},
+ getmRoomSlot(){
+ let that = this;
+ let form = {};
+ form.page = 0;
+ form.mroom = that.form.mroom;
+ form.mdate = that.form.mdate;
+ that.timesList.forEach(slot=>{
+ slot.sloted = false;
+ })
+ that.$API.ofm.mroomslot.list.req(form).then(res=>{
+ res.forEach(item=>{
+ that.timesList[item.slot].sloted = true;
+ })
+ })
+ },
+ mdateChange(){
+ let that = this;
+ if(that.form.mroom!==''&&that.form.mroom!==null){
+ that.getmRoomSlot();
+ }
+ },
mRoomChange(){
let that = this;
that.mRoomList.forEach(item=>{
if(item.id == that.form.mroom){
that.mroomName = item.name;
that.bookingTitle = item.name+"预定";
+ if(that.form.mdate!==''&&that.form.mdate!==null){
+ that.getmRoomSlot();
+ }
}
})
},
@@ -254,7 +286,14 @@ export default {
})
})
},
+ //搜索
+ handleQuery() {
+ this.$refs.table.queryData(this.query);
},
+ slotMessage(){
+ this.$message.warning("该时间段已被预约,不可选择");
+ },
+ },
};
@@ -281,5 +320,9 @@ export default {
background-color: #00a870;
color: #fff;
}
+.slotedTimeBlock{
+ background-color: #fac275;
+ color: #fff;
+}
diff --git a/src/views/ofm/mroombooking.vue b/src/views/ofm/mroombooking.vue
index 207cec7d..a87a4a7b 100644
--- a/src/views/ofm/mroombooking.vue
+++ b/src/views/ofm/mroombooking.vue
@@ -75,10 +75,11 @@
{this.mode=mode;console.log('mode',mode)}"
+ @changeMode="(mode)=>{this.mode=mode;}"
@success="handleSuccess"
@closed="handleCancel"
>