diff --git a/application/admin/controller/CfSuplierInfo.php b/application/admin/controller/CfSuplierInfo.php index 629f4f9..d5ce07e 100755 --- a/application/admin/controller/CfSuplierInfo.php +++ b/application/admin/controller/CfSuplierInfo.php @@ -128,12 +128,13 @@ class CfSuplierInfo extends Backend $this->model->field('id,supplier_name as name'); $groupDao = new GroupDao(); $group_id = $groupDao->getTopGroup($this->auth->getGroupId()); + $where = ["group_id"=>$group_id]; if($keyValue){ - $this->model->where(['id'=>$keyValue,"group_id"=>$group_id]); + $where = ['id'=>$keyValue,"group_id"=>$group_id]; }elseif($name){ - $this->model->where(['supplier_name'=>['like','%'.$name.'%'],"group_id"=>$group_id]); + $where = ['supplier_name'=>['like','%'.$name.'%'],"group_id"=>$group_id]; } - $result= $this->model->select(); + $result= $this->model->where($where)->select(); if($keyValue){ return json(['list' => $result]); } diff --git a/application/admin/view/cf_room_plan/index.html b/application/admin/view/cf_room_plan/index.html index 99cc504..46e2499 100755 --- a/application/admin/view/cf_room_plan/index.html +++ b/application/admin/view/cf_room_plan/index.html @@ -96,37 +96,74 @@ - -
- -
-
-
-
- - - -
-
- - - - - - - - - - -
-
- - - -
-
- 保存 -
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + 无限制 + 连住几晚 + 连住几晚及以上 + 连住几晚及其倍数 + + + + + + + + + + + + + + + + + 保 存 +
@@ -159,6 +196,7 @@ }, hotelList:[], roomList:[], + editRoomList:[], roomAllList:[], userList: [], //连续入住类型 0无限制 1连住几晚 2连住几晚及以上 3连住几晚及其倍数 @@ -167,8 +205,8 @@ {id:1,name:"连住几晚"}, {id:2,name:"连住几晚及以上"}, {id:3,name:"连住几晚及其倍数"} - ] - + ], + edit_city_set:2 } }, created() { @@ -186,6 +224,27 @@ }).catch(function (error) { console.log(error); }); + }, + "editData.hotel_id" : function (newVal,oldVal){ + if (this.edit_city_set==2) { + this.editRoomList = [] + this.editData.room_id = "" + } + if (newVal == "") { + return false + } + axios.post("/hotel.php/cf_room_info/getRoomList?hotelId="+newVal, {}).then((response) => { + let data = response.data; + this.editRoomList = data.list; + this.edit_city_set++ + }).catch(function (error) { + console.log(error); + }); + }, + "editData.continuity_type" : function (newVal,oldVal) { + if (newVal == 0) { + this.editData.coutinuity_day = 0; + } } }, methods: { @@ -263,27 +322,25 @@ }); }, edit(info) { - this.$message.error("功能待完善"); - return false if (info == null) { this.editType = false; this.editData = { hotel_id:"", room_id:"", plan_name:"", - breakfast_num:"", - book_end_day:"", - book_end_hour:"", + breakfast_num:0, + book_end_day:0, + book_end_hour:0, continuity_type:0, - coutinuity_day:"", + coutinuity_day:0, plan_memo:"", purchase_user_id:"", - } } else { this.edit_city_set = 1; this.editType = true; this.editData = { + id:info.id, hotel_id:info.hotel_id, room_id:info.room_id, plan_name:info.plan_name, @@ -308,28 +365,21 @@ if (this.editData.plan_name==''){ this.$message.error("名称不能为空");return false; } - if (this.editData.breakfast_num==''){ + if (this.editData.breakfast_num===''){ this.$message.error("早餐数量不能为空");return false; } - if (this.editData.book_end_day==''){ + if (this.editData.book_end_day===''){ this.$message.error("提前几天预定不能为空");return false; } - if (this.editData.book_end_hour==''){ + if (this.editData.book_end_hour===''){ this.$message.error("几点前预定不能为空");return false; } - if (this.editData.continuity_type==''){ - this.$message.error("选择入住类型不能");return false; - } - if (this.editData.coutinuity_day==''){ + if (this.editData.coutinuity_day===''){ this.$message.error("连续入住天数不能为空");return false; } - if (this.editData.plan_memo==''){ - this.$message.error("方案说明不能为空");return false; - } if (this.editData.purchase_user_id==''){ this.$message.error("请选择采购负责人");return false; } - this.setAreaName(); axios.post("/hotel.php/cf_room_plan/save", this.editData).then( (response)=> { let data = response.data; console.log(this.tableData);