Browse Source

房型配置

qh 2 years ago
parent
commit
6ff7b20d1d

+ 1 - 1
public/index.html

@@ -250,7 +250,7 @@
     <div id="loader"></div>
     <div class="loader-section section-left"></div>
     <div class="loader-section section-right"></div>
-    <div class="load_title">正在加载 JeecgBoot 低代码平台,请耐心等待
+    <div class="load_title">正在加载,请耐心等待
 
     </div>
   </div>

+ 8 - 1
src/api/api.js

@@ -95,6 +95,12 @@ const getTransitURL = url => `/sys/common/transitRESTful?url=${encodeURIComponen
 const getRoomPlans = (code,params)=>postAction(`/rooms/roomPricePlan/getRoomPlans/${code}`,params);
 //排除指定id列表查询
 const getSelectList = (params)=>getAction(`/org.jeecg.modules.business/busMarketMember/getSelectList/`,params);
+/**
+ * 获取会员等级接口
+ * @param {Object} params 
+ * @returns 
+ */
+const getVipLevels = (params)=>getAction(`/org.jeecg.modules.business/busMarketMember/list/`,params);
 
 const getBusMarketMemberLablList = (params)=>getAction(`/business/busMarketMemberLable/list`,params);
 const getBusMarketMemberGroupList = (params)=>getAction(`/business/busMarketMemberGroup/list`,params);
@@ -173,7 +179,8 @@ export {
   deleteMarketMemberGroup,
   deleteMarketMemberLable,
   getBusMarketCouponsList,
-  getBusMarketCouponsCashList
+  getBusMarketCouponsCashList,
+  getVipLevels
 }
 
 

+ 1 - 1
src/components/layouts/TabLayout.vue

@@ -183,7 +183,7 @@
        * @param title 要修改的新标题
        */
       changeTitle(title) {
-        let projectTitle = "Jeecg-Boot 企业级低代码平台"
+        let projectTitle = "酒店管理租户端"
         // 首页特殊处理
         if (this.$route.path === indexKey) {
           document.title = projectTitle

+ 14 - 14
src/components/tools/UserMenu.vue

@@ -2,11 +2,11 @@
   <div class="user-wrapper" :class="theme">
     <!-- update_begin author:zhaoxin date:20191129 for: 做头部菜单栏导航 -->
     <!-- update-begin author:sunjianlei date:20191@20 for: 解决全局样式冲突的问题 -->
-    <span class="action" @click="showClick">
+    <!-- <span class="action" @click="showClick">
       <a-icon type="search"></a-icon>
-    </span>
+    </span> -->
     <!-- update-begin author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框 -->
-    <component :is="searchMenuComp" v-show="searchMenuVisible || isMobile()" class="borders" :visible="searchMenuVisible" title="搜索菜单" :footer="null" @cancel="searchMenuVisible=false">
+    <!-- <component :is="searchMenuComp" v-show="searchMenuVisible || isMobile()" class="borders" :visible="searchMenuVisible" title="搜索菜单" :footer="null" @cancel="searchMenuVisible=false">
       <a-select
         class="search-input"
         showSearch
@@ -22,15 +22,15 @@
       >
         <a-select-option v-for="(site,index) in searchMenuOptions" :key="index" :value="site.id">{{site.meta.title}}</a-select-option>
       </a-select>
-    </component>
+    </component> -->
     <!-- update-end author:sunjianlei date:20200219 for: 菜单搜索改为动态组件,在手机端呈现出弹出框 -->
     <!-- update-end author:sunjianlei date:20191220 for: 解决全局样式冲突的问题 -->
     <!-- update_end  author:zhaoxin date:20191129 for: 做头部菜单栏导航 -->
-    <span class="action">
+    <!-- <span class="action">
       <a class="logout_title" target="_blank" href="http://doc.jeecg.com">
         <a-icon type="question-circle-o"></a-icon>
       </a>
-    </span>
+    </span> -->
     <header-notice class="action"/>
     <a-dropdown>
       <span class="action action-full ant-dropdown-link user-dropdown-menu">
@@ -38,30 +38,30 @@
         <span v-if="isDesktop()">欢迎您,{{ nickname() }}</span>
       </span>
       <a-menu slot="overlay" class="user-dropdown-menu-wrapper">
-        <a-menu-item key="0">
+        <!-- <a-menu-item key="0">
           <router-link :to="{ name: 'account-center' }">
             <a-icon type="user"/>
             <span>个人中心</span>
           </router-link>
-        </a-menu-item>
-        <a-menu-item key="1">
+        </a-menu-item> -->
+        <!-- <a-menu-item key="1">
           <router-link :to="{ name: 'account-settings-base' }">
             <a-icon type="setting"/>
             <span>账户设置</span>
           </router-link>
-        </a-menu-item>
-        <a-menu-item key="3"  @click="systemSetting">
+        </a-menu-item> -->
+        <!-- <a-menu-item key="3"  @click="systemSetting">
            <a-icon type="tool"/>
            <span>系统设置</span>
-        </a-menu-item>
+        </a-menu-item> -->
         <a-menu-item key="4" @click="updatePassword">
           <a-icon type="setting"/>
           <span>密码修改</span>
         </a-menu-item>
-        <a-menu-item key="5" @click="updateCurrentDepart">
+        <!-- <a-menu-item key="5" @click="updateCurrentDepart">
           <a-icon type="cluster"/>
           <span>切换部门</span>
-        </a-menu-item>
+        </a-menu-item> -->
         <a-menu-item key="6" @click="clearCache">
           <a-icon type="sync"/>
           <span>清理缓存</span>

+ 0 - 1
src/views/settings/components/roomModules/RoomLayoutPriceModal.vue

@@ -4,7 +4,6 @@
         <a-tabs
         default-active-key="1"
         tab-position="left"
-        :style="{ height: '200px' }"
       >
         <a-tab-pane  tab="全天房" key="1">
             <room-qtf-price-table v-if="raw" :layout-id="raw.id"></room-qtf-price-table>

+ 196 - 55
src/views/settings/components/roomModules/RoomQtfPriceTable.vue

@@ -1,15 +1,16 @@
 <template>
-    <div>
-        <a-table :columns="columns" :data-source="data"  :pagination="false" :loading="loading">
+    <div >
+        <a-table :columns="columns" :data-source="data" :pagination="false" :loading="loading">
             <span slot="prepay" slot-scope="text, record, index">
-                <a-switch checked-children="是" un-checked-children="否" :checked="record.prepay" @change="changePrepay(record)"/>
-              </span>
-              <span slot="isVip" slot-scope="text, record, index">
+                <a-switch checked-children="是" un-checked-children="否" :checked="record.prepay"
+                    @change="changePrepay(record)" />
+            </span>
+            <span slot="isVip" slot-scope="text, record, index">
                 <a-switch checked-children="是" un-checked-children="否" :checked="record.isVip" />
-              </span>
-              <span slot="action" slot-scope="text, record">
+            </span>
+            <span slot="action" slot-scope="text, record">
                 <a @click="handleEdit(record)">编辑</a>
-    
+
                 <a-divider type="vertical" />
                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                     <a>删除</a>
@@ -17,48 +18,89 @@
             </span>
         </a-table>
         <a-form-model layout="inline" ref="form" :model="model" :rules="validatorRules" slot="detail">
-            <a-form-model-item label="价格名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
-                <a-input v-model="model.name" placeholder="请输入房价名称"></a-input>
-            </a-form-model-item>
-            <a-form-model-item label="原价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="oprice">
-                <a-input-number style="width:100%;" v-model="model.oprice" :min="1"  placeholder="请填写原价"/>
-            </a-form-model-item>
-            <a-form-model-item label="现价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
-                <a-input-number style="width:100%;" v-model="model.oprice" :min="1"  placeholder="请填写现价"/>
-            </a-form-model-item>
-            <a-form-model-item label="预付" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="prepay">
-                <a-radio-group v-model="model.prepay">
-                    <a-radio :value="1">
-                      是
-                    </a-radio>
-                    <a-radio :value="0">
-                      否
-                    </a-radio>                    
-                  </a-radio-group>
-            </a-form-model-item>
-            <a-form-model-item label="积分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="integral">
-                <a-input-number style="width:100%;" v-model="model.integral"  placeholder="请填写积分"/>
-            </a-form-model-item>
-            <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
-                <a-input-number style="width:100%;" v-model="model.num"  placeholder="请填写数量"/>
-            </a-form-model-item>
-            <a-form-model-item label="会员折扣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isVip">
-                <a-radio-group v-model="model.isVip">
-                    <a-radio :value="1">
-                      是
-                    </a-radio>
-                    <a-radio :value="0">
-                      否
-                    </a-radio>                    
-                  </a-radio-group>
-            </a-form-model-item>
+            <a-row>
+                <a-col :span="3">
+                    <a-form-model-item label="价格名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
+                        <a-input v-model="model.name" placeholder="请输入房价名称"></a-input>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="3">
+                    <a-form-model-item label="原价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="oprice">
+                        <a-input-number style="width:100%;" v-model="model.oprice" :min="1" placeholder="请填写原价" />
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="3">
+                    <a-form-model-item label="现价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
+                        <a-input-number style="width:100%;" v-model="model.price" :min="1" placeholder="请填写现价" />
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="3">
+                    <a-form-model-item label="预付"  prop="prepay">
+                        <a-radio-group v-model="model.prepay">
+                            <a-radio-button :value="1">
+                                是
+                            </a-radio-button>
+                            <a-radio-button :value="0">
+                                否
+                            </a-radio-button>
+                        </a-radio-group>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="3">
+                    <a-form-model-item label="积分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="integral">
+                        <a-input-number style="width:100%;" v-model="model.integral" placeholder="请填写积分" />
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="3">
+                    <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
+                        <a-input-number style="width:100%;" v-model="model.num" placeholder="请填写数量" />
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="3">
+                    <a-form-model-item label="会员折扣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isVip">
+                        <a-radio-group v-model="model.isVip" @change="onVipChange">
+                            <a-radio-button :value="1">
+                                是
+                            </a-radio-button>
+                            <a-radio-button :value="0">
+                                否
+                            </a-radio-button>
+                        </a-radio-group>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="1">
+                    <a-button @click="submitForm" type="primary">保存</a-button>
+                </a-col>
+            </a-row>
         </a-form-model>
+
+        <div class="vip-config" v-if="model.isVip">
+            <div class="config-heads h-title">
+                <div class="head-item">会员等级</div>
+                <div class="head-item">原价</div>
+                <div class="head-item">折扣(%)</div>
+                <div class="head-item">现价</div>
+            </div>
+            <div class="config-heads" v-for="item in vipLevels" :key="item.id">
+                <div class="head-item">[{{ item.name }}]</div>
+                <div class="head-item">
+                    <a-input-number style="width:80%;" v-model="model.oprice" :min="0" placeholder="请填写原价" @change="vipOpriceChange($event, item)"/>
+                </div>
+                <div class="head-item">
+                    <a-input-number style="width:80%;" v-model="item.discount" :min="0" placeholder="请填写折扣" @change="vipDiscountChange($event, item)"/>
+                </div>
+                <div class="head-item">
+                    <a-input-number style="width:80%;" :value="item.price" :min="0" placeholder="请填写现价" @change="vipPriceChange($event, item)"/>
+                </div>
+            </div>
+        </div>
     </div>
 </template>
 
 <script>
 import { list } from '@/api/roomLayoutPrice'
-
+import { httpAction, getAction } from "@/api/manage";
+import * as api from '@/api/api'
 const columns = [
     {
         title: '房价名称',
@@ -92,7 +134,7 @@ const columns = [
         key: 'num',
     },
     {
-        title:'使用会员折扣',
+        title: '使用会员折扣',
         dataIndex: 'isVip',
         key: 'isVip',
         scopedSlots: { customRender: 'isVip' },
@@ -112,11 +154,11 @@ export default {
         return {
             labelCol: {
                 xs: { span: 24 },
-                sm: { span: 8 },
+                sm: { span: 10 },
             },
             wrapperCol: {
                 xs: { span: 24 },
-                sm: { span: 16 },
+                sm: { span: 14 },
             },
             loading: false,
             data: [],
@@ -138,17 +180,68 @@ export default {
                 prepay: 0,
                 integral: 0,
                 num: 0,
-            }
+                isVip: 0
+            },
+            vipLevels: [],
+            origiVipLevels: []
         };
     },
 
     mounted() {
         this.getData()
+        this.getVipLevels()
     },
-
     methods: {
+        vipPriceChange(e, item) {
+            if(this.model.oprice) {
+                item.discount = ((e / this.model.oprice) * 100).toFixed(2)
+            }
+            item.price = e
+        },
+        vipDiscountChange(e, item) {
+            if(this.model.oprice) {
+                item.price = (this.model.oprice * (e/100)).toFixed(2)
+            }
+            item.discount = e
+        },
+        vipOpriceChange(e, item) {
+            if(item.discount) {
+                item.price = (this.model.oprice * (item.discount/100)).toFixed(2)
+            }
+            this.model.oprice = e
+        },
+        getVipLevels() {
+            api.getVipLevels({
+                pageNo: 1,
+                pageSize: 999,
+                hotelId: hotelItem.id
+            }).then(res => {
+                if(res.result && res.result.records) {
+                    
+                    res.result.records.forEach(s=>{
+                        s['price'] = 0
+                        if(!s.discount) {
+                            s.discount = 100
+                        }
+                    })
+                    this.origiVipLevels = res.result.records
+                    this.vipLevels = JSON.parse(JSON.stringify(res.result.records))
+                }
+            })
+        },
         changePrepay(record) {
-            
+
+        },
+        onVipChange(e) {
+            if(this.model.isVip) {
+
+            }
+        },
+        handleEdit(record) {
+            let cpData = JSON.parse(JSON.stringify(record))
+            cpData.isVip = record.isVip? 1 : 0
+            cpData.prepay = record.prepay? 1 : 0
+            this.model = cpData
         },
         getData() {
             this.loading = true
@@ -158,22 +251,70 @@ export default {
                 roomLayoutId: this.layoutId,
                 pageNo: 1,
                 pageSize: 999
-            }).then(res=>{
+            }).then(res => {
                 this.loading = false
                 console.log(res)
                 this.data = res.result.records
-            }).catch(res=>{
+            }).catch(res => {
                 this.loading = false
             })
         },
         handleDelete(id) {
 
-        }
+        },
+        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";
+                    // }
+                    // if (this.model.payFlag == 0) {
+                    //     this.model.payAmount = 0;
+                    // }
+                    // 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>
 
-<style lang="stylus" scoped>
-
+<style lang="css" scoped>
+.vip-config{
+    width: 30%;
+    height: 200px;
+    overflow-y: auto;
+    margin-top: 20px;
+}
+.config-heads{
+    display: flex;
+}
+.config-heads .head-item{
+    flex: 1;
+    text-align: left;
+}
+.h-title{
+    font-weight: 600;
+}
 </style>

+ 1 - 1
src/views/user/oauth2/OAuth2Login.vue

@@ -4,7 +4,7 @@
       <div id="loader"></div>
       <div class="loader-section section-left"></div>
       <div class="loader-section section-right"></div>
-      <div class="load_title">正在登录 JeecgBoot 低代码平台,请耐心等待</div>
+      <div class="load_title">正在登录,请耐心等待</div>
     </div>
   </div>
 </template>

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ module.exports = {
       /* 注意:jeecgboot前端做了改造,此处不需要配置跨域和后台接口(只需要改.env相关配置文件即可)
           issues/3462 很多人此处做了配置,导致刷新前端404问题,请一定注意*/
       '/jeecg-boot': {
-        target: 'http://localhost:8080',
+        target: 'http://localhost:8070',
         ws: false,
         changeOrigin: true
       },