浏览代码

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-tenant-frontend

# Conflicts:
#	src/views/markets/agreementunit.vue
gqx 2 年之前
父节点
当前提交
c22142e503

+ 1 - 1
src/views/fangwu/tabList/houseTypeConsumables.vue

@@ -15,7 +15,7 @@
         <j-input placeholder="商品名称" v-model="queryParam.name" style="width: 200px;margin-right:8px;"></j-input>
         <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
         <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-        <!-- <a-range-picker style="margin-right:8px;" @change="onChangeTime" /> -->
+        <!--  style="margin-right:8px;" @change="onChangeTime" /> -->
         <a-popconfirm v-if="selectedRowKeys.length > 0" title="确定删除吗?" @confirm="delBatch">
             <a-button :disabled="delLoading" :loading="delLoading" icon="stop" style="">
                 批量删除</a-button>

+ 84 - 0
src/views/markets/modules/agreementUnit/agreementUnitModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <agreement-unit-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></agreement-unit-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import agreementUnitForm from './agreementUnitForm'
+
+  export default {
+    name: 'agreementUnitModal',
+    components: {
+      agreementUnitForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/markets/modules/agreementUnit/agreementUnitModal.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="关闭">
+    <agreement-unit-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></agreement-unit-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import agreementUnitForm from './agreementUnitForm'
+  export default {
+    name: 'agreementUnitModal',
+    components: {
+      agreementUnitForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      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>

+ 336 - 0
src/views/settings/components/roomModules/housePriceSchemeList.vue

@@ -0,0 +1,336 @@
+<template>
+    <a-card :bordered="false">
+        <!-- 查询区域 -->
+        <div class="table-page-search-wrapper">
+            <a-form layout="inline" @keyup.enter.native="searchQuery">
+                <a-row :gutter="24">
+                    <a-col :span="6">
+                        <a-form-item label="关键字">
+                            <a-input placeholder="关键字(方案、编号、简码)" v-model="queryParam.paramName" allowClear></a-input>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="6" :sm="8">
+                        <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                            <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                            <a-button type="primary" @click="searchReset" icon="reload"
+                                      style="margin-left: 8px">重置</a-button>
+                        </span>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </div>
+        <!-- 查询区域-END -->
+
+        <!-- 操作按钮区域 -->
+        <div class="table-operator">
+            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+            <a-dropdown v-if="selectedRowKeys.length > 0">
+<!--                <a-button style="margin-left: 8px">-->
+<!--                    批量操作 <a-icon type="down" /></a-button>-->
+                <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
+            </a-dropdown>
+        </div>
+
+        <!-- table区域-begin -->
+        <div>
+            <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
+        >项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div> -->
+
+            <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
+                     :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
+                    selectedRowKeys: selectedRowKeys,
+                    onChange: onSelectChange,
+                }" class="j-table-force-nowrap" @change="handleTableChange">
+                <template slot="openSlot" slot-scope="text, record, index">
+                    <a-switch checked-children="开" un-checked-children="关" default-checked :checked="record.open == 1"
+                              @change="e=>changeOpenState(e,record)" />
+                </template>
+                <template slot="htmlSlot" slot-scope="text">
+                    <div v-html="text"></div>
+                </template>
+                <template slot="imgSlot" slot-scope="text, record">
+                    <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
+                    <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
+                         style="max-width: 80px; font-size: 12px; font-style: italic" />
+                </template>
+                <template slot="fileSlot" slot-scope="text">
+                    <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
+                    <a-button v-else :ghost="true" type="primary" icon="download" size="small"
+                              @click="downloadFile(text)">
+                        下载
+                    </a-button>
+                </template>
+
+                <span slot="action" slot-scope="text, record">
+                    <a @click="handleEdit(record)">编辑</a>
+
+                    <a-divider type="vertical" />
+                    <a-dropdown>
+                        <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+                        <a-menu slot="overlay">
+                            <a-menu-item>
+                                <a @click="handlePriceManager(record)">价格管理</a>
+                            </a-menu-item>
+                            <a-menu-item>
+                                <a @click="handleDetailSetting(record)">详细设置</a>
+                            </a-menu-item>
+                            <a-menu-item>
+                                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                                    <a>删除</a>
+                                </a-popconfirm>
+                            </a-menu-item>
+                        </a-menu>
+                    </a-dropdown>
+                </span>
+            </a-table>
+        </div>
+<!--        <room-layout-form ref="modalForm" @ok="modalFormOk"></room-layout-form>-->
+<!--        <room-layout-price-modal ref="priceModal" @ok="onPriceSave"></room-layout-price-modal>-->
+<!--        <room-layout-detail-modal @saveOk="onSaveOk" ref="detailModal"></room-layout-detail-modal>-->
+        <house-price-scheme-modal ref="modalForm" @ok="modalFormOk"></house-price-scheme-modal>
+    </a-card>
+</template>
+
+<script>
+
+    import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+    import roomLayoutForm from "./RoomLayoutFormModal"; // todo roomLayoutForm 需要替换成房型的表单弹窗
+    import RoomLayoutDetailModal from "./RoomLayoutFormDetailModal.vue";
+
+    import RoomLayoutPriceModal from "./RoomLayoutPriceModal.vue";
+
+    import { modifyAppState } from '@/api/roomLayout'
+    import { filterObj } from "@/utils/util";
+    import HousePriceSchemeModal from "./modules/housePriceSchemeModal";
+    let hotelInfo = JSON.parse(localStorage.getItem('storeInfo'))
+    import { httpAction, getAction } from '@/api/manage'
+    export default {
+        name: "housePriceSchemeList",
+        mixins: [JeecgListMixin],
+        components: {
+            HousePriceSchemeModal,
+            roomLayoutForm,
+            RoomLayoutPriceModal,
+            RoomLayoutDetailModal
+        },
+        data() {
+            return {
+                queryParam: {},
+                // 分页参数
+                ipagination: {
+                    current: 1,
+                    pageSize: 10,
+                    pageSizeOptions: ["10", "20", "30"],
+                    showTotal: (total, range) => {
+                        return range[0] + "-" + range[1] + " 共" + total + "条";
+                    },
+                    showQuickJumper: true,
+                    showSizeChanger: true,
+                    total: 0,
+                },
+                // 表头
+                columns: [
+                    {
+                        title: "简码",
+                        align: "center",
+                        dataIndex: "simpleCode",
+                    },
+                    {
+                        title: "编号",
+                        align: "center",
+                        dataIndex: "number",
+                    },
+                    {
+                        title: "房价方案",
+                        align: "center",
+                        dataIndex: "priceScheme",
+
+                    },
+                    {
+                        title: "客人类型",
+                        align: "center",
+                        dataIndex: "guestTypeName",
+                    },
+                    {
+                        title: "入住时间",
+                        align: "center",
+                        dataIndex: "checkInTimeText",
+                    },
+                    {
+                        title: "有效期",
+                        align: "center",
+                        dataIndex: "validTimeText",
+                    },
+                    {
+                        title: "状态",
+                        align: "center",
+                        dataIndex: "open",
+                        scopedSlots: {customRender: "openSlot"},
+                    },
+                    {
+                        title: "排序",
+                        align: "center",
+                        dataIndex: "sort",
+                    },
+                    {
+                        title: "操作时间",
+                        align: "center",
+                        dataIndex: "createAt",
+                    },
+                    {
+                        title: "操作",
+                        dataIndex: "action",
+                        align: "center",
+                        fixed: "right",
+                        width: 147,
+                        scopedSlots: {customRender: "action"},
+                    },
+                ],
+                url: {
+                    // list: 'org.jeecg.modules.business/busMarketMember/list',
+                    list: "/rooms/cesHousePriceScheme/list?hotelId=" + hotelInfo.id,
+                    delete: "/rooms/cesHousePriceScheme/remove",
+                    deleteBatch: "/rooms/cesHousePriceScheme/deleteBatch",
+                    exportXlsUrl: "/rooms/cesHousePriceScheme/exportXls",
+                    importExcelUrl:
+                        "rooms/cesHousePriceScheme/importExcel",
+                    modifyOpen: "/rooms/cesHousePriceScheme/modifyOpen",
+                },
+                dictOptions: {},
+                superFieldList: [],
+                selectedRowKeys: [],
+                isorter: {
+                    column: "createTime",
+                    order: "desc",
+                },
+            };
+        },
+        created() {
+            // this.loadData()
+        },
+        methods: {
+            onSaveOk() {
+                this.loadData()
+            },
+            onPriceSave() {
+
+            },
+            handlePriceManager(record) {
+                this.$refs.priceModal.setRaw(record.id, record.name)
+                this.$refs.priceModal.visible = true
+            },
+            handleDetailSetting(record) {
+                this.$refs.detailModal.setRaw(record)
+                this.$refs.detailModal.visible = true
+            },
+            changeOpenState(e, record) {
+                console.log(e)
+                var that = this;
+                this.confirmLoading = true
+                httpAction(this.url.modifyOpen +'/'+ record.id + "?open=" + (e ? 1 : 0), {}, 'put').then((res) => {
+                    if (res.success) {
+                        that.$message.success('操作成功')
+                        that.$emit('ok')
+                        that.loadData(1);
+                    } else {
+                        that.$message.warning(res.message)
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false
+                })
+            },
+            changeAppState(e, param) {
+                modifyAppState(param).then(res => {
+                    if (res.code == 200) {
+                        this.loadData();
+                    }
+                })
+            },
+            getAvatarView: function (avatar) {
+                return getFileAccessHttpUrl(avatar);
+            },
+
+            batchFrozen: function (status) {
+                if (this.selectedRowKeys.length <= 0) {
+                    this.$message.warning("请选择一条记录!");
+                    return false;
+                } else {
+                    let ids = "";
+                    let that = this;
+                    let isAdmin = false;
+                    that.selectionRows.forEach(function (row) {
+                        if (row.username == "admin") {
+                            isAdmin = true;
+                        }
+                    });
+                    if (isAdmin) {
+                        that.$message.warning("管理员账号不允许此操作,请重新选择!");
+                        return;
+                    }
+                    that.selectedRowKeys.forEach(function (val) {
+                        ids += val + ",";
+                    });
+                    that.$confirm({
+                        title: "确认操作",
+                        content: "是否" + (status == 1 ? "解冻" : "冻结") + "选中账号?",
+                        onOk: function () {
+                            frozenBatch({ids: ids, status: status}).then((res) => {
+                                if (res.success) {
+                                    that.$message.success(res.message);
+                                    that.loadData();
+                                    that.onClearSelected();
+                                } else {
+                                    that.$message.warning(res.message);
+                                }
+                            });
+                        },
+                    });
+                }
+            },
+            handleMenuClick(e) {
+                if (e.key == 1) {
+                    this.batchDel();
+                } else if (e.key == 2) {
+                    this.batchFrozen(2);
+                } else if (e.key == 3) {
+                    this.batchFrozen(1);
+                }
+            },
+            handleFrozen: function (id, status, username) {
+                let that = this;
+                //TODO 后台校验管理员角色
+                if ("admin" == username) {
+                    that.$message.warning("管理员账号不允许此操作!");
+                    return;
+                }
+                frozenBatch({ids: id, status: status}).then((res) => {
+                    if (res.success) {
+                        that.$message.success(res.message);
+                        that.loadData();
+                    } else {
+                        that.$message.warning(res.message);
+                    }
+                });
+            },
+            handleChangePassword(username) {
+                this.$refs.passwordmodal.show(username);
+            },
+            passwordModalOk() {
+                //TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
+            },
+            onSyncFinally({isToLocal}) {
+                // 同步到本地时刷新下数据
+                if (isToLocal) {
+                    this.loadData();
+                }
+            },
+        },
+    };
+</script>
+<style scoped>
+    @import "~@assets/less/common.less";
+</style>

+ 47 - 3
src/views/settings/components/roomModules/marketObjectiveList.vue

@@ -97,6 +97,17 @@
           <template slot="nightSlot" slot-scope="text,record">
               <a-input-number v-model="record.night" style="width: 70%" :min="0" :step="1" :precision="2"/>
           </template>
+          <template slot="footer" slot-scope="currentPageData">
+              <div class='subtotal'>
+                  <div class='left'>合计</div>
+                  <div class='number'>{{ total1.toFixed(2) }}</div>
+                  <div class='number'>{{ total2.toFixed(2) }}</div>
+                  <div class='number'>{{ total3.toFixed(2) }}</div>
+                  <div class='number'>{{ total4.toFixed(2) }}</div>
+                  <div class='number'>{{ total5.toFixed(2) }}</div>
+                  <div class='number'>{{  }}</div>
+              </div>
+          </template>
       </a-table>
     </div>
     <a-button type="primary" @click="submitData" style="margin-top: 20px">保存</a-button>
@@ -172,7 +183,12 @@
               dictOptions: {},
               superFieldList: [],
               yearShowOne: false,
-              hotelId:''
+              hotelId:'',
+              total1:0,
+              total2:0,
+              total3:0,
+              total4:0,
+              total5:0
           }
       },
       beforeCreate() {
@@ -268,10 +284,38 @@
               }).finally(() => {
                   that.confirmLoading = false;
               })
-          }
+          },
       }
   }
 </script>
-<style scoped>
+<style scoped lang="less">
   @import '~@assets/less/common.less';
+  .subtotal {
+      height: 50px;
+      position: absolute;
+      bottom: -10px;
+      width: 97%;
+      border: 1px solid #e8e8e8;
+      background: #F4F4F4;
+      display: flex;
+      align-items: center;
+      font-weight: 900;
+      overflow-x: scroll;
+      overflow-y: hidden;
+
+      .left {
+          flex: none; /* div显示滚动条的重点 */
+          width: 510px;
+      }
+
+      .number {
+          flex: none;
+          color: #666666;
+          height: 100%;
+          width: 150px;
+          display: flex;
+          align-items: center;
+          padding-left: 15px;
+      }
+  }
 </style>

+ 449 - 0
src/views/settings/components/roomModules/modules/housePriceSchemeForm.vue

@@ -0,0 +1,449 @@
+<template>
+    <a-spin :spinning="confirmLoading">
+        <j-form-container :disabled="formDisabled">
+            <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+                <a-form-model-item label="房价方案" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priceScheme">
+                    <a-input v-model="model.priceScheme" placeholder="请输入房价方案" allowClear></a-input>
+                </a-form-model-item>
+                <a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
+                    <a-input v-model="model.number" placeholder="请输入编号"></a-input>
+                </a-form-model-item>
+                <a-form-model-item label="客人来源" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="guestSource">
+                    <a-select
+                            v-model="model.guestSource"
+                            placeholder="请选择客人来源"
+                            :allowClear="true"
+                    >
+                        <a-select-option :value="item.id" v-for="(item,index) in customerSourceList" :key="index">{{ item.itemText }}</a-select-option>
+                    </a-select>
+                </a-form-model-item>
+                <a-form-model-item label="客人类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="guestType">
+                    <a-row>
+                        <a-col :span="10">
+                            <a-select
+                                    style="width: 100%"
+                                    v-model="model.guestType"
+                                    placeholder="请选择客人类型"
+                                    :allowClear="true"
+                                    @change="e=>handleGuestType(e)"
+                            >
+                                <a-select-option :value="undefined">请选择</a-select-option>
+                                <a-select-option :value="item.value" v-for="item in guestTypeList" :key="item.value">{{ item.text }}</a-select-option>
+                            </a-select>
+                        </a-col>
+                        <a-col :span="8">
+                            <a-select
+                                    v-if="model.guestType == 2"
+                                    style="width: 100%"
+                                    v-model="model.martketMemberId"
+                                    placeholder="请选择会员"
+                                    :allowClear="true"
+                                    @change="e=>handleGuestType(e)"
+                            >
+                                <a-select-option :value="undefined">请选择</a-select-option>
+                                <a-select-option :value="item.id" v-for="item in customerList" :key="item.id">{{ item.name }}</a-select-option>
+                            </a-select>
+
+                            <a-select
+                                    v-if="model.guestType == 3"
+                                    style="width: 100%"
+                                    v-model="model.agreementUnitId"
+                                    placeholder="请选择协议单位"
+                                    :allowClear="true"
+                                    @change="e=>handleGuestType(e)"
+                            >
+                                <a-select-option :value="undefined">请选择</a-select-option>
+                                <a-select-option :value="item.id" v-for="item in agreementUnitList" :key="item.id">{{ item.customerName }}</a-select-option>
+                            </a-select>
+
+                            <a-input v-if="model.guestType == 4" style="width: 90%;margin: auto;" v-model="model.mediation" placeholder="请输入名称/简介/联系人"></a-input>
+                        </a-col>
+                    </a-row>
+                </a-form-model-item>
+                <a-form-model-item label="入住时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="checkInTime">
+                    <a-radio-group v-model="model.checkInTime">
+                        <a-radio :value="0">无限制</a-radio>
+                        <a-radio :value="1">时间段</a-radio>
+                    </a-radio-group>
+                    <a-row>
+                        <a-col :span="16">
+                            <a-range-picker @change="onCheckTimeChange" v-model="checkTimeRange" format="YYYY-MM-DD 00:00:00" v-if="model.checkInTime == 1" />
+                        </a-col>
+                    </a-row>
+                </a-form-model-item>
+                <a-form-model-item label="周末假日" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weekends">
+                    <a-checkbox-group v-model="model.weekends" @change="onChange">
+                        <a-checkbox :value="item.value" v-for="item in weeks" :key="item.value">
+                            {{ item.text }}
+                        </a-checkbox>
+                    </a-checkbox-group>
+                </a-form-model-item>
+                <a-form-model-item label="节假日" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="holiday">
+                    <a-date-picker valueFormat="YYYY-MM-DD"
+                                   v-model="model.holiday"
+                                   :open='open'
+                                   type="dates"
+                                   :showToday="false"
+                                   @ok="handleOk"
+                                   @change="handleChange"
+                                   @openChange="openChangeOne"
+                                   @panelChange="panelChangeOne">
+                        <template slot="renderExtraFooter" style="float: right">
+                            <a-button slot="addon" size="small" @click="handleHolidCancel">
+                                取消
+                            </a-button>
+                            <a-button class="margin_left_6" slot="addon" size="small" type="primary" @click="handleHolidConfirm">
+                                确定
+                            </a-button>
+                        </template>
+                    </a-date-picker>
+                </a-form-model-item>
+                <a-form-model-item label="有效期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="validTime">
+                    <a-radio-group v-model="model.validTime">
+                        <a-radio :value="0">无限制</a-radio>
+                        <a-radio :value="1">时间段</a-radio>
+                    </a-radio-group>
+                    <a-row>
+                        <a-col :span="16">
+                            <a-range-picker @change="onValidTimeChange" v-model="validTimeRange" format="YYYY-MM-DD 00:00:00" v-if="model.validTime == 1" />
+                        </a-col>
+                    </a-row>
+                </a-form-model-item>
+                <a-form-model-item label="是否开启" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="openValue">
+                    <a-switch checked-children="开启" un-checked-children="关闭" default-checked
+                              v-model="model.openValue"
+                              @change="e=>onOpenChange(e)"/>
+                </a-form-model-item>
+
+                <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
+                    <a-input-number style="width:50%;" v-model="model.sort" :min="0"  placeholder="请填写排序"/>
+                </a-form-model-item>
+            </a-form-model>
+
+        </j-form-container>
+    </a-spin>
+</template>
+<script>
+    import { getRoomPlans, getSelectList } from "@/api/api";
+    import { httpAction, getAction } from "@/api/manage";
+    import { validateDuplicateValue } from "@/utils/util";
+    import { initDictOptions } from '@/components/dict/JDictSelectUtil'
+    import moment from 'moment'
+    export default {
+        name: "housePriceSchemeForm",
+        props: {
+            disabled: {
+                type: Boolean,
+                default: false,
+                required: false,
+            },
+        },
+        data() {
+            return {
+                model: {
+                    weekends:[],
+                },
+                labelCol: {
+                    xs: { span: 24 },
+                    sm: { span: 5 },
+                },
+                wrapperCol: {
+                    xs: { span: 24 },
+                    sm: { span: 16 },
+                },
+                confirmLoading: false,
+                validatorRules: {
+                    priceScheme: [{ required: true, message: "请输入房价方案!" }],
+                    number: [{ required: true, message: "请输入编号!" }],
+                    guestSource: [{ required: true, message: "请选择客人来源!" }],
+                    guestType: [{ required: true, message: "请选择客人类型!" }],
+                    checkInTime: [{ required: true, message: "请选择入住时间!" }],
+                    validTime: [{ required: true, message: "请选择有效期!" }],
+                    open: [{ required: true, message: "请选择是否开启!" }],
+                    sort: [{ required: true, message: "请填写排序!" }],
+                },
+                url: {
+                    add: "/rooms/cesHousePriceScheme/save",
+                    edit: "/rooms/cesHousePriceScheme/modify",
+                    queryById: "/rooms/cesHousePriceScheme/queryById",
+                    queryCustomerList:'/org.jeecg.modules.business/busMarketMember/queryList',
+                    queryAgreementUnitList:'/business/busMarketAgreementUnit/queryList',
+                },
+                iconChooseVisible: false,
+                customerSourceList:[],
+                guestTypeList:[],
+                weeks:[],
+                open: false,
+                customerList:[],
+                agreementUnitList:[],
+                checkTimeRange:[],
+                validTimeRange:[],
+            };
+        },
+        computed: {
+            formDisabled() {
+                return this.disabled;
+            },
+        },
+        created() {
+            var _info = JSON.parse(localStorage.getItem("storeInfo"));
+            if (_info) {
+                this.model.hotelId = _info.id;
+                this.initData();
+                this.getDictConfig();
+            }
+            this.modelDefault = JSON.parse(JSON.stringify(this.model));
+        },
+        methods: {
+            initData() {
+                getRoomPlans(this.model.hotelId, null).then((res) => {
+                    if (res.success) {
+                        this.roomPlans = res.result;
+                    }
+                });
+
+            },
+            getDictConfig(){
+                var that = this;
+                //客户来源
+                var param = {
+                    dictName:'客人来源设置'
+                }
+                // var values = JSON.parse(JSON.stringify(param))
+                that.confirmLoading = true;
+                getAction('/business/busDictItem/queryList',param).then((res)=>{
+                    console.log(res)
+                    if(res.success){
+                        if (res.code == 200 && res.result) {
+                            this.customerSourceList = res.result;
+                        }
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+
+                //初始化字典 - 客人类型
+                initDictOptions('guest_type').then((res) => {
+                    if (res.success) {
+                        this.guestTypeList = res.result;
+                    }
+                });
+                //初始化字典 - 客人类型
+                initDictOptions('house_price_zmjr').then((res) => {
+                    if (res.success) {
+                        that.weeks = res.result;
+                    }
+                });
+
+                getAction(this.url.queryCustomerList,{}).then((res)=>{
+                    if(res.success){
+                        this.customerList = res.result
+                    }else{
+
+                    }
+                })
+
+                getAction(this.url.queryAgreementUnitList,{}).then((res)=>{
+                    if(res.success){
+                        this.agreementUnitList = res.result
+                    }else{
+
+                    }
+                })
+            },
+            selectIcons() {
+                this.iconChooseVisible = true;
+            },
+            handleIconCancel() {
+                this.iconChooseVisible = false;
+            },
+            handleIconChoose(value) {
+                console.log(value);
+                this.model.icon = value;
+                this.iconChooseVisible = false;
+            },
+            add() {
+                this.edit(this.modelDefault);
+            },
+            edit(record) {
+                let _record = record
+                _record.guestType = record.guestType.toString();
+                if (record.id){
+                    if (record.open == 1){
+                        _record.openValue =true
+                    }else{
+                        _record.openValue =false
+                    }
+
+                    if (record.weekend.length > 0){
+                        _record.weekends = record.weekend.split(',');
+                    }
+                }else{
+                    _record.checkInTime = 0
+                    _record.validTime = 0
+                }
+
+                console.log(_record)
+                this.model = Object.assign({}, _record);
+                this.visible = true;
+                if(this.model.id){
+                    if (this.model.checkInTime === 1){
+                        this.checkTimeRange =
+                            [moment(new Date(this.model.startTime)).format('YYYY-MM-DD 00:00:00'),
+                                moment(new Date(this.model.endTime)).format('YYYY-MM-DD 00:00:00')]
+                    }
+                    if (this.model.validTime === 1){
+                        this.validTimeRange =
+                            [moment(new Date(this.model.validStartTime)).format('YYYY-MM-DD 00:00:00'),
+                                moment(new Date(this.model.validEndTime)).format('YYYY-MM-DD 00:00:00')]
+                    }
+
+                }
+
+                getSelectList({ id: this.model.id }).then((res) => {
+                    if (res.success) {
+                        this.members = res.result;
+                    }
+                });
+            },
+            onCheckTimeChange(date, dateString) {
+                // this.checkStartTime = dateString[0];
+                // this.checkEndTime = dateString[1];
+                // if (date.length === 0) {
+                //     this.checkTimeRange = [];
+                // } else {
+                //     console.log("这是开始时间", this.$moment(this.checkTimeRange[0]).format('YYYY-MM-DD 00:00:00'));
+                //     console.log("这是结束时间", this.$moment( this.checkTimeRange[1]).format('YYYY-MM-DD 00:00:00'));
+                // }
+            },
+            onValidTimeChange(date, dateString) {
+                // this.validStartTime = dateString[0];
+                // this.validEndTime = dateString[1];
+                // if (date.length === 0) {
+                //     this.validTimeRange = [];
+                // } else {
+                //     console.log("这是开始时间", this.$moment(this.validTimeRange[0]).format('YYYY-MM-DD 00:00:00'));
+                //     console.log("这是结束时间", this.$moment( this.validTimeRange[1]).format('YYYY-MM-DD 00:00:00'));
+                // }
+                // console.log(this.validTimeRange.length);
+            },
+            onOpenChange(e){
+                console.log(e)
+                console.log(this.model.openValue)
+                // this.model.open = e?1:0;
+                // this.model.openValue = e
+
+                // this.model.openValue = !this.model.openValue
+                this.model.openValue = e;
+            },
+            submitForm() {
+                const that = this;
+                // 触发表单验证
+                if (this.model.checkInTime == 1){
+                    this.model.startTime =moment(this.checkTimeRange[0]).format('YYYY-MM-DD 00:00:00');
+                    this.model.endTime =moment(this.checkTimeRange[1]).format('YYYY-MM-DD 00:00:00');
+                }
+                if (this.model.validTime == 1){
+                    this.model.validStartTime =moment(this.validTimeRange[0]).format('YYYY-MM-DD 00:00:00');
+                    this.model.validEndTime =moment(this.validTimeRange[1]).format('YYYY-MM-DD 00:00:00');
+                }
+                this.model.weekend = this.model.weekends.join(',');
+                this.model.open = this.model.openValue?1:0;
+                console.log(this.model)
+                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;
+                            });
+                    }
+                });
+            },
+            onChange(){
+
+            },
+            handleHolidCancel() {
+                this.open = false
+            },
+            handleHolidConfirm(){
+                this.open = false
+            },
+            moment,
+            range(start, end) {
+                const result = [];
+                for (let i = start; i < end; i++) {
+                    result.push(i);
+                }
+                return result;
+            },
+
+            disabledDate(current) {
+                // Can not select days before today and today
+                return current && current < moment().endOf('day');
+            },
+
+            disabledDateTime() {
+                return {
+                    disabledHours: () => this.range(0, 24).splice(4, 20),
+                    disabledMinutes: () => this.range(30, 60),
+                    disabledSeconds: () => [55, 56],
+                };
+            },
+            // 弹出日历和关闭日历的回调
+            openChangeOne(status) {
+                if (status) {
+                    this.open = true
+                }
+            },
+            // 得到年份选择器的值
+            panelChangeOne(value) {
+                this.queryParam.year = moment(new Date(value)).format('YYYY');
+                this.open = false;
+            },
+            handleOk(e){
+                console.log(e)
+            },
+            handleChange(e){
+                console.log(e)
+                console.log(this.model.holiday)
+                this.model.holiday = e+",";
+            },
+            handleFocus(){
+                this.open = true;
+            },
+            handleGuestType(e){
+                console.log(e)
+            }
+        },
+    };
+</script>
+<style scoped>
+    .avatar-uploader>.ant-upload {
+        width: 104px;
+        height: 104px;
+    }
+    .margin_left_6{
+        margin-left: 6px;
+    }
+</style>

+ 60 - 0
src/views/settings/components/roomModules/modules/housePriceSchemeModal.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="关闭">
+        <house-price-scheme-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></house-price-scheme-form>
+    </j-modal>
+</template>
+
+<script>
+
+    import HousePriceSchemeForm from "./housePriceSchemeForm";
+    export default {
+        name: 'housePriceSchemeModal',
+        components: {
+            HousePriceSchemeForm,
+        },
+        data () {
+            return {
+                title:'',
+                width:950,
+                visible: false,
+                disableSubmit: false
+            }
+        },
+        methods: {
+            add () {
+                this.visible=true
+                this.$nextTick(()=>{
+                    this.$refs.realForm.add();
+                })
+            },
+            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>

+ 3 - 0
src/views/settings/roomSettings.vue

@@ -42,6 +42,7 @@
                     <a-icon type="file" />
                     房价方案
                 </span>
+                <house-price-scheme-list></house-price-scheme-list>
             </a-tab-pane>
             <a-tab-pane key="7">
                 <span slot="tab">
@@ -85,8 +86,10 @@ import ServiceRepairList from "./components/roomModules/serviceRepairList";
 import hourRoomRuleList from './components/roomModules/hourRoomRule/table.vue'
 import MarketObjectiveList from "./components/roomModules/marketObjectiveList";
 import RoomUtilitySettingList from "./components/roomModules/roomUtilitySettingList";
+import HousePriceSchemeList from "./components/roomModules/housePriceSchemeList";
 export default {
     components: {
+        HousePriceSchemeList,
         RoomUtilitySettingList,
         MarketObjectiveList,
         ServiceRepairList,