Browse Source

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

shenzhongzheng 2 years ago
parent
commit
212771f5e8
33 changed files with 4474 additions and 39799 deletions
  1. 0 39719
      package-lock.json
  2. 53 0
      src/api/roomLayoutPrice.js
  3. BIN
      src/assets/clear.png
  4. BIN
      src/assets/eye.png
  5. 1 1
      src/components/menu/index.js
  6. 0 1
      src/utils/excloudHotelIdParamPath/CesRoomLayoutPriceController.js
  7. 342 0
      src/views/markets/coupons.vue
  8. 132 0
      src/views/markets/marketInfo.vue
  9. 250 0
      src/views/markets/modules/BusMarketCouponsForm.vue
  10. 84 0
      src/views/markets/modules/BusMarketCouponsModal.Style#Drawer.vue
  11. 60 0
      src/views/markets/modules/BusMarketCouponsModal.vue
  12. 171 0
      src/views/markets/modules/BusMarketCouponsUsedForm.vue
  13. 145 0
      src/views/markets/modules/BusMarketCouponsUsedGenerateForm.vue
  14. 60 0
      src/views/markets/modules/BusMarketCouponsUsedGenerateFormModal.vue
  15. 354 0
      src/views/markets/modules/BusMarketCouponsUsedList.vue
  16. 64 0
      src/views/markets/modules/BusMarketCouponsUsedListModal.vue
  17. 84 0
      src/views/markets/modules/BusMarketCouponsUsedModal.Style#Drawer.vue
  18. 60 0
      src/views/markets/modules/BusMarketCouponsUsedModal.vue
  19. 162 0
      src/views/markets/modules/Provide/MobileForm.vue
  20. 320 0
      src/views/markets/modules/Provide/UserList.vue
  21. 75 0
      src/views/markets/modules/Provide/index.vue
  22. 5 5
      src/views/settings/components/modules/BusMarketCouponsEventDetailForm.vue
  23. 1 1
      src/views/settings/components/modules/BusMarketCouponsEventDetailList.vue
  24. 962 4
      src/views/settings/components/paramSettings.vue
  25. 53 0
      src/views/settings/components/roomModules/RoomLayoutFormDetailModal.vue
  26. 23 17
      src/views/settings/components/roomModules/RoomLayoutPriceModal.vue
  27. 171 50
      src/views/settings/components/roomModules/RoomQtfPriceTable.vue
  28. 561 0
      src/views/settings/components/roomModules/RoomZdfPriceTable.vue
  29. 165 0
      src/views/settings/components/roomModules/roomLayoutDetailForm.vue
  30. 36 0
      src/views/settings/components/roomModules/roomLayoutDetailForm/roomLayoutDetail.vue
  31. 36 0
      src/views/settings/components/roomModules/roomLayoutDetailForm/roomLayoutDevice.vue
  32. 36 0
      src/views/settings/components/roomModules/roomLayoutDetailForm/roomLayoutImage.vue
  33. 8 1
      src/views/settings/components/roomModules/roomLayoutList.vue

File diff suppressed because it is too large
+ 0 - 39719
package-lock.json


+ 53 - 0
src/api/roomLayoutPrice.js

@@ -16,4 +16,57 @@ export function list(parameter) {
 }
 
 
+/**
+ * 更新房型价格
+ * @param {object} parameter 参数
+ * @returns Axios Promise
+ */
+ export function modify(parameter) {
+    return axios({
+        url: '/rooms/cesRoomLayoutPrice/modify',
+        method: 'post',
+        data: parameter
+    })
+}
+
+/**
+ * 新增房型价格
+ * @param {object} parameter 参数
+ * @returns Axios Promise
+ */
+ export function create(parameter) {
+    return axios({
+        url: '/rooms/cesRoomLayoutPrice/create',
+        method: 'post',
+        data: parameter
+    })
+}
+
+/**
+ * 获取配置过的房型价格会员等级折扣
+ * @param {object} parameter 
+ * @returns 
+ */
+export function getLayoutpriceLevels(parameter) {
+    return axios({
+        url: '/rooms/cesRoomLayoutMemberPrice/getListByParentId',
+        method: 'get',
+        params: parameter
+    })
+}
+
+
+
+/**
+ * 获取钟点房计费规则
+ * @param {object} parameter 
+ * @returns 
+ */
+ export function getHourRoomRule(parameter) {
+    return axios({
+        url: '/rooms/cesHourRoomRule/list',
+        method: 'get',
+        params: parameter
+    })
+}
 

BIN
src/assets/clear.png


BIN
src/assets/eye.png


+ 1 - 1
src/components/menu/index.js

@@ -129,7 +129,7 @@ export default {
     // render
     renderItem (menu) {
       if (!menu.hidden) {
-        return menu.children && !menu.alwaysShow ? this.renderSubMenu(menu) : this.renderMenuItem(menu)
+        return menu.children && !menu.alwaysShow &&menu.path!='/tenant/marketinfo'? this.renderSubMenu(menu) : this.renderMenuItem(menu)
       }
       return null
     },

+ 0 - 1
src/utils/excloudHotelIdParamPath/CesRoomLayoutPriceController.js

@@ -1,7 +1,6 @@
 export default {
     name: '房价管理模块',
     excloudUrls: [
-        '/rooms/cesRoomLayoutPrice/list',
         '/sys/randomImage'
     ]
 }

+ 342 - 0
src/views/markets/coupons.vue

@@ -0,0 +1,342 @@
+<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="4">
+            <a-form-item label="">
+              <a-input
+                placeholder="免房券名称"
+                v-model="queryParam.name"
+              ></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="">
+              <a-range-picker
+                format="YYYY-MM-DD"
+                :placeholder="['开始日期', '结束日期']"
+                @change="onChange"
+                v-model="datetime"
+              />
+            </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-button type="primary" icon="download" @click="handleExportXls('bus_market_coupons_info')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload> -->
+      <!-- 高级查询区域 -->
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></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="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="handleConfig(record)">详情</a>
+          <a-divider type="vertical" />
+          <a @click="handleProvide(record)">发放</a>
+          <a-divider type="vertical" />
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a @click="handleDelete(record.id)">删除</a>
+        </span>
+      </a-table>
+    </div>
+
+    <bus-market-coupons-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></bus-market-coupons-modal>
+    <bus-market-coupons-used-list-modal
+      ref="modalCouponsUsedListModal"
+      :couponsId="couponsId"
+    ></bus-market-coupons-used-list-modal>
+
+    <provide-index-modal
+      ref="modalProvideIndexModal"
+      :couponsId="couponsId"
+      @ok="modalFormOk"
+    ></provide-index-modal>
+  </a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import { mixinDevice } from "@/utils/mixin";
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+import BusMarketCouponsModal from "./modules/BusMarketCouponsModal";
+import BusMarketCouponsUsedListModal from "./modules/BusMarketCouponsUsedListModal";
+import ProvideIndexModal from "./modules/Provide/index";
+import { deleteAction } from "@/api/manage";
+export default {
+  name: "coupons",
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    BusMarketCouponsModal,
+    BusMarketCouponsUsedListModal,
+    ProvideIndexModal,
+  },
+  data() {
+    return {
+      couponsId: "",
+      datetime: [],
+      queryParam: {},
+      description: "bus_market_coupons_info管理页面",
+      // 表头
+      columns: [
+        // {
+        //   title: "#",
+        //   dataIndex: "",
+        //   key: "rowIndex",
+        //   width: 60,
+        //   align: "center",
+        //   customRender: function (t, r, index) {
+        //     return parseInt(index) + 1;
+        //   },
+        // },
+        // {
+        //   title: "关联租户",
+        //   align: "center",
+        //   dataIndex: "tenantId",
+        // },
+        {
+          title: "商家",
+          align: "center",
+          dataIndex: "hotelName",
+        },
+        {
+          title: "名称",
+          align: "center",
+          dataIndex: "name",
+        },
+        {
+          title: "开始时间",
+          align: "center",
+          dataIndex: "startTime",
+          customRender: function (text) {
+            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          },
+        },
+        {
+          title: "结束时间",
+          align: "center",
+          dataIndex: "endTime",
+          customRender: function (text) {
+            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          },
+        },
+        {
+          title: "生成数量",
+          align: "center",
+          dataIndex: "count",
+        },
+        {
+          title: "待领取",
+          align: "center",
+          dataIndex: "notClaimed",
+        },
+        {
+          title: "已领取",
+          align: "center",
+          dataIndex: "received",
+        },
+        {
+          title: "已使用",
+          align: "center",
+          dataIndex: "used",
+        },
+        {
+          title: "已作废",
+          align: "center",
+          dataIndex: "voided",
+        },
+        {
+          title: "每人可领取张数",
+          align: "center",
+          dataIndex: "klqzs",
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 147,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
+      url: {
+        list: "/business/busMarketCoupons/list",
+        delete: "/business/busMarketCoupons/delete",
+        deleteBatch: "/business/busMarketCoupons/deleteBatch",
+        exportXlsUrl: "/business/busMarketCoupons/exportXls",
+        importExcelUrl: "business/busMarketCoupons/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+    };
+  },
+  created() {
+    // this.getSuperFieldList();
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
+    },
+  },
+  methods: {
+    handleDelete: function (id) {
+      if (!this.url.delete) {
+        this.$message.error("请设置url.delete属性!");
+        return;
+      }
+      var that = this;
+      this.$confirm({
+        title: "确认删除",
+        content: "是否删除?",
+        onOk: function () {
+          deleteAction(that.url.delete, { id: id }).then((res) => {
+            if (res.success) {
+              //重新计算分页问题
+              that.reCalculatePage(1);
+              that.$message.success(res.message);
+              that.loadData();
+            } else {
+              that.$message.warning(res.message);
+            }
+          });
+        },
+        onCancel: function () {},
+      });
+    },
+    handleProvide(item) {
+      this.couponsId = item.id;
+      this.$refs.modalProvideIndexModal.visible = true;
+      this.$refs.modalProvideIndexModal.title = "发放";
+    },
+    handleConfig(item) {
+      this.couponsId = item.id;
+      // this.$refs.modalCouponsUsedListModal.eventId = item.id;
+      this.$refs.modalCouponsUsedListModal.visible = true;
+      this.$refs.modalCouponsUsedListModal.title = "详情";
+      this.$refs.modalCouponsUsedListModal.add(item.id);
+    },
+    searchReset() {
+      this.datetime =[];
+      this.queryParam = {};
+      this.loadData(1);
+    },
+    onChange(e, dateString) {
+      // console.log("Selected Time: ", e);
+      // console.log("Formatted Selected Time: ", dateString);
+      this.queryParam.startTime = dateString[0];
+      this.queryParam.endTime = dateString[1];
+    },
+    initDictConfig() {},
+    getSuperFieldList() {
+      let fieldList = [];
+      fieldList.push({ type: "string", value: "tenantId", text: "关联租户" });
+      fieldList.push({ type: "string", value: "hotelId", text: "关联酒店" });
+      fieldList.push({ type: "string", value: "name", text: "名称" });
+      fieldList.push({ type: "date", value: "startTime", text: "开始时间" });
+      fieldList.push({ type: "date", value: "endTime", text: "结束时间" });
+      fieldList.push({ type: "string", value: "tenantId", text: "适用房型" });
+      fieldList.push({ type: "int", value: "klqzs", text: "可领取张数" });
+      fieldList.push({ type: "string", value: "type", text: "类型" });
+      fieldList.push({ type: "string", value: "introduce", text: "说明" });
+      fieldList.push({ type: "int", value: "lqNum", text: "领取数量" });
+      fieldList.push({ type: "string", value: "ruleDec", text: "使用说明" });
+      this.superFieldList = fieldList;
+    },
+  },
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 132 - 0
src/views/markets/marketInfo.vue

@@ -0,0 +1,132 @@
+<template>
+  <a-card :bordered="false">
+    <p>会员分组设置</p>
+    <a-divider />
+    <div class="space-align-container">
+      <div class="height-100" @click="toPage()">
+        <img
+          src="http://oss.qlan99.com/20200529/733024169836404bb2db66450167dd06.png"
+        />
+        <p>会员列表</p>
+      </div>
+
+      <div class="height-100" @click="toPage()">
+        <img
+          src="http://oss.qlan99.com/20200529/4446ad625b404d64ac67494266d2452b.png"
+          width="50"
+        />
+        <p>会员充值</p>
+      </div>
+    </div>
+    <p style="margin-top: 25px">营销管理</p>
+    <a-divider />
+    <div class="space-align-container">
+      <div class="height-100" @click="toPage()">
+        <img
+          src="http://oss.qlan99.com/20200529/7346d2530c61445bbd0638f98d863f23.png"
+        />
+        <p>营销短信</p>
+      </div>
+      <div class="height-100" @click="toPage()">
+        <img
+          src="https://oss.qlan99.com/20200525/5a16520de701452d885cdcbfd2508e50.png"
+        />
+        <p>协议单位</p>
+      </div>
+      <div class="height-100" @click="toPage()">
+        <img
+          src="http://oss.qlan99.com/20200529/7a270d9a3a534034ac03c2fdd23139ab.png"
+        />
+        <p>餐券核销</p>
+      </div>
+      <div class="height-100" @click="toPage()">
+        <img
+          src="http://oss.qlan99.com/20200529/7a270d9a3a534034ac03c2fdd23139ab.png"
+        />
+        <p>优惠券</p>
+      </div>
+      <div class="height-100" @click="toPage('/tenant/marketinfo/coupons')">
+        <img
+          src="http://oss.qlan99.com/20200529/7a270d9a3a534034ac03c2fdd23139ab.png"
+          width="50"
+        />
+        <p>免房券</p>
+      </div>
+    </div>
+    <!-- <p>会员分组设置</p>
+    <a-divider />
+    <a-space>
+      <div class="height-100">
+        <img
+          src="http://oss.qlan99.com/20200529/733024169836404bb2db66450167dd06.png"
+        />
+        <p>会员列表</p>
+      </div>
+      <div class="height-100">
+        <img
+          src="http://oss.qlan99.com/20200529/4446ad625b404d64ac67494266d2452b.png"
+          width="50"
+        />
+        <p>会员充值</p>
+      </div>
+    </a-space> -->
+  </a-card>
+</template>
+
+<script>
+export default {
+  data() {
+    return {};
+  },
+  methods: {
+    toPage(url) {
+      if(!url){
+        this.$message.warning('开发中,请先体验免房券');
+        return
+      }
+      this.$router.push(url);
+    },
+  },
+};
+</script>
+
+<style scoped>
+.height-100 {
+  height: 100px;
+  line-height: 100px;
+  background: #f5f5f5;
+  width: 15vw;
+  align-items: center;
+  display: flex;
+  cursor: pointer;
+  padding: 4px;
+  margin: 8px 4px;
+}
+.height-100 img {
+  margin: 15px;
+  width: 50px;
+  height: 50px;
+}
+.height-100 p {
+  font-weight: 600;
+  font-size: 14px;
+  color: #000;
+}
+
+.space-align-container {
+  display: flex;
+  align-items: flex-start;
+  flex-wrap: wrap;
+}
+.space-align-block {
+  margin: 8px 4px;
+  border: 1px solid #40a9ff;
+  padding: 4px;
+  flex: none;
+}
+.space-align-block .mock-block {
+  display: inline-block;
+  padding: 32px 8px 16px;
+  background: rgba(150, 150, 150, 0.2);
+}
+</style>

+ 250 - 0
src/views/markets/modules/BusMarketCouponsForm.vue

@@ -0,0 +1,250 @@
+<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="tenantId">
+              <a-input v-model="model.tenantId" placeholder="请输入关联租户"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="关联酒店" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hotelId">
+              <a-input v-model="model.hotelId" placeholder="请输入关联酒店"  ></a-input>
+            </a-form-model-item>
+          </a-col> -->
+          <a-col :span="24">
+            <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="24">
+            <a-form-model-item
+              label="开始时间"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="startTime"
+            >
+              <j-date
+                placeholder="请选择开始时间"
+                v-model="model.startTime"
+                style="width: 100%"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="结束时间"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="endTime"
+            >
+              <j-date
+                placeholder="请选择结束时间"
+                v-model="model.endTime"
+                style="width: 100%"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="适用房型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="roomIds"
+            >
+              <a-checkbox-group
+                :options="roomLayouts"
+                v-model="model.roomLayouts"
+              >
+                <!-- <template v-for="i of roomLayouts">
+                  <a-checkbox
+                    class="list-check-item"
+                    :key="`key-${i}`"
+                    :value="i.id"
+                    >{{ i.name }}</a-checkbox
+                  >
+                </template> -->
+              </a-checkbox-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="每人可领取张数"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="klqzs"
+            >
+              <a-input-number
+                v-model="model.klqzs"
+                placeholder="请输入可领取张数"
+                style="width: 100%"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="说明"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="introduce"
+            >
+              <a-input
+                v-model="model.introduce"
+                placeholder="请输入说明"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="使用说明"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="ruleDec"
+            >
+              <a-input
+                v-model="model.ruleDec"
+                placeholder="请输入使用说明"
+              ></a-input>
+            </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: "BusMarketCouponsForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      roomLayouts: [],
+      model: { },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        name: [{ required: true, message: "请输入名称!" }],
+        startTime: [{ required: true, message: "请输入开始时间!" }],
+        endTime: [{ required: true, message: "请输入结束时间!" }],
+        klqzs: [{ required: true, message: "请输入每人可领取张数!" }],
+        introduce: [{ required: true, message: "请输入说明!" }],
+      },
+      url: {
+        add: "/business/busMarketCoupons/add",
+        edit: "/business/busMarketCoupons/edit",
+        queryById: "/business/busMarketCoupons/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(e) {
+    //   console.log("e", e);
+    //   var ids = [];
+    //   if (e && e.length > 0) {
+    //     // e.forEach((item) => {
+    //     //   ids.push(item.id);
+    //     // });
+    //     this.model.roomIds = ids.join(",");
+    //   } else {
+    //     this.model.roomIds = "";
+    //   }
+    //   this.model.roomLayouts = e;
+    // },
+    add() {
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      console.log("record", record);
+      var roomLayouts = (record.roomIds || "").split(",");
+      this.model = Object.assign({}, record, { roomLayouts: roomLayouts });
+      this.visible = true;
+      getAction("/rooms/cesRoomLayout/list", { pageNo: 1, pageSize: 100 })
+        .then((res) => {
+          if (res.success) {
+            this.roomLayouts = res.result.records;
+            var data = [];
+            res.result.records.forEach((item) => {
+              data.push({ label: item.name, value: item.id });
+            });
+            this.roomLayouts = data;
+          }
+        })
+        .finally(() => {});
+    },
+    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";
+          }
+          this.model.roomIds = this.model.roomLayouts.join(",");
+          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>

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

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <bus-market-coupons-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></bus-market-coupons-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 BusMarketCouponsForm from './BusMarketCouponsForm'
+
+  export default {
+    name: 'BusMarketCouponsModal',
+    components: {
+      BusMarketCouponsForm
+    },
+    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/BusMarketCouponsModal.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="关闭">
+    <bus-market-coupons-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-coupons-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMarketCouponsForm from './BusMarketCouponsForm'
+  export default {
+    name: 'BusMarketCouponsModal',
+    components: {
+      BusMarketCouponsForm
+    },
+    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>

+ 171 - 0
src/views/markets/modules/BusMarketCouponsUsedForm.vue

@@ -0,0 +1,171 @@
+<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="tenantId">
+              <a-input v-model="model.tenantId" placeholder="请输入关联租户"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="关联酒店" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hotelId">
+              <a-input v-model="model.hotelId" placeholder="请输入关联酒店"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="免房券id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="couponsId">
+              <a-input v-model="model.couponsId" placeholder="请输入免房券id"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="券号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code">
+              <a-input v-model="model.code" placeholder="请输入券号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="状态 0未领取 1已领取 2已使用 3已作废" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
+              <a-input-number v-model="model.status" placeholder="请输入状态 0未领取 1已领取 2已使用 3已作废" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="会员id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userid">
+              <a-input v-model="model.userid" placeholder="请输入会员id"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userName">
+              <a-input v-model="model.userName" placeholder="请输入姓名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="房间号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="roomNumber">
+              <a-input v-model="model.roomNumber" placeholder="请输入房间号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="入住单号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="checkedInNo">
+              <a-input v-model="model.checkedInNo" placeholder="请输入入住单号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mobile">
+              <a-input v-model="model.mobile" placeholder="请输入手机号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="领取时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gainTime">
+              <j-date placeholder="请选择领取时间" v-model="model.gainTime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="使用时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="usedTime">
+              <j-date placeholder="请选择使用时间" v-model="model.usedTime"  style="width: 100%" />
+            </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: 'BusMarketCouponsUsedForm',
+    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: {
+           tenantId: [
+              { required: true, message: '请输入关联租户!'},
+           ],
+           hotelId: [
+              { required: true, message: '请输入关联酒店!'},
+           ],
+           couponsId: [
+              { required: true, message: '请输入免房券id!'},
+           ],
+           code: [
+              { required: true, message: '请输入券号!'},
+           ],
+        },
+        url: {
+          add: "/business/busMarketCouponsUsed/add",
+          edit: "/business/busMarketCouponsUsed/edit",
+          queryById: "/business/busMarketCouponsUsed/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        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>

+ 145 - 0
src/views/markets/modules/BusMarketCouponsUsedGenerateForm.vue

@@ -0,0 +1,145 @@
+<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" v-show="false">
+            <a-form-model-item
+              label="免房券id"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="couponsId"
+            >
+            <a-input-number
+                v-model="model.couponsId"
+                style="width: 100%"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="已生成数量"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              <p>{{ total }}</p>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="生成数量"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="num"
+            >
+              <a-input-number
+                v-model="model.num"
+                placeholder="请输入张数"
+                style="width: 100%"
+              />
+            </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: "BusMarketCouponsUsedForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      total: 0,
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        //  couponsId: [
+        //     { required: true, message: '请输入免房券id!'},
+        //  ],
+        num: [{ required: true, message: "请输入生成数量!" }],
+      },
+      url: {
+        add: "/business/busMarketCouponsUsed/generate",
+        edit: "/business/busMarketCouponsUsed/edit",
+        queryById: "/business/busMarketCouponsUsed/queryById",
+      },
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+  },
+  methods: {
+    add(total, couponsId) {
+      this.total = total;
+      this.modelDefault.couponsId = couponsId;
+      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/markets/modules/BusMarketCouponsUsedGenerateFormModal.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="关闭">
+    <bus-market-coupons-used-generate-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-coupons-used-generate-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMarketCouponsUsedGenerateForm from './BusMarketCouponsUsedGenerateForm'
+  export default {
+    name: 'BusMarketCouponsUsedGenerateFormModal',
+    components: {
+      BusMarketCouponsUsedGenerateForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (total,couponsId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(total,couponsId);
+        })
+      },
+      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>

+ 354 - 0
src/views/markets/modules/BusMarketCouponsUsedList.vue

@@ -0,0 +1,354 @@
+<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="">
+              <j-input placeholder="券号" v-model="queryParam.code"></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="">
+              <j-input
+                placeholder="姓名"
+                v-model="queryParam.user_name"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="">
+              <j-input
+                placeholder="手机号"
+                v-model="queryParam.mobile"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="4">
+            <a-form-item label="">
+              <a-select
+                v-model:value="queryParam.status"
+                style="width: 120px"
+                placeholder="请选择状态"
+                :allowClear="true"
+              >
+                <a-select-option value="0">未领取</a-select-option>
+                <a-select-option value="1">已领取</a-select-option>
+                <a-select-option value="2">已使用</a-select-option>
+                <a-select-option value="3">已作废</a-select-option>
+              </a-select>
+            </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
+              >
+              <a-button
+                @click="handleAdd"
+                type="primary"
+                icon="plus"
+                style="margin-left: 8px"
+                >生成免房券</a-button
+              >
+              <a-button
+                type="primary"
+                icon="delete"
+                style="margin-left: 8px"
+                @click="batchDel"
+                >批量删除</a-button
+              >
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- table区域-begin -->
+    <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="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 v-if="record.statusName!=='已作废'" @click="handleEdit(record)">作废</a>
+        </span>
+      </a-table>
+    </div>
+
+    <bus-market-coupons-used-generate-form-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></bus-market-coupons-used-generate-form-modal>
+  </a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import { mixinDevice } from "@/utils/mixin";
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+import BusMarketCouponsUsedGenerateFormModal from "./BusMarketCouponsUsedGenerateFormModal";
+import { httpAction, getAction } from "@/api/manage";
+
+export default {
+  name: "BusMarketCouponsUsedList",
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    BusMarketCouponsUsedGenerateFormModal,
+  },
+  props: {
+    couponsId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      description: "免房券领取使用表管理页面",
+      // 表头
+      columns: [
+        {
+          title: "券号",
+          align: "center",
+          dataIndex: "code",
+        },
+        {
+          title: "免房券名称",
+          align: "center",
+          dataIndex: "conponsName",
+        },
+        // {不知道这个金额是干啥用,数据库表中没加金额字段
+        //   title: "金额",
+        //   align: "center",
+        //   dataIndex: "",
+        // },
+        {
+          title: "姓名",
+          align: "center",
+          dataIndex: "userName",
+        },
+
+        {
+          title: "房间号",
+          align: "center",
+          dataIndex: "roomNumber",
+        },
+        {
+          title: "入住单号",
+          align: "center",
+          dataIndex: "checkedInNo",
+        },
+        {
+          title: "手机号",
+          align: "center",
+          dataIndex: "mobile",
+        },
+        {
+          title: "领取时间",
+          align: "center",
+          dataIndex: "gainTime",
+          // customRender: function (text) {
+          //   return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          // },
+        },
+        {
+          title: "使用时间",
+          align: "center",
+          dataIndex: "usedTime",
+          // customRender: function (text) {
+          //   return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          // },
+        },
+        {
+          title: "状态",
+          align: "center",
+          dataIndex: "statusName",
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 80,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
+      url: {
+        list: "/business/busMarketCouponsUsed/list?couponsId=" + this.couponsId,
+        delete: "/business/busMarketCouponsUsed/delete",
+        deleteBatch: "/business/busMarketCouponsUsed/deleteBatch",
+        exportXlsUrl: "/business/busMarketCouponsUsed/exportXls",
+        importExcelUrl: "business/busMarketCouponsUsed/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+    };
+  },
+  created() {
+    this.getSuperFieldList();
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
+    },
+  },
+  methods: {
+    handleEdit(item) {
+      var that = this;
+      this.$confirm({
+        title: "确认作废",
+        content: "是否作废?",
+        onOk: function () {
+          httpAction(
+            "/business/busMarketCouponsUsed/voided",
+            { id: item.id },
+            "put"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                item.statusName = "已作废";
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {});
+        },
+        onCancel: function () {},
+      });
+    },
+    initDictConfig() {},
+    getSuperFieldList() {
+      let fieldList = [];
+      fieldList.push({
+        type: "string",
+        value: "tenantId",
+        text: "关联租户",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "hotelId",
+        text: "关联酒店",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "couponsId",
+        text: "免房券id",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "code",
+        text: "券号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "int",
+        value: "status",
+        text: "状态 0未领取 1已领取 2已使用 3已作废",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "userid",
+        text: "会员id",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "userName",
+        text: "姓名",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "roomNumber",
+        text: "房间号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "checkedInNo",
+        text: "入住单号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "mobile",
+        text: "手机号",
+        dictCode: "",
+      });
+      fieldList.push({ type: "date", value: "gainTime", text: "领取时间" });
+      fieldList.push({ type: "date", value: "usedTime", text: "使用时间" });
+      this.superFieldList = fieldList;
+    },
+    handleAdd() {
+      this.$refs.modalForm.add(this.ipagination.total, this.couponsId);
+      this.$refs.modalForm.title = "免房券生成";
+      this.$refs.modalForm.disableSubmit = false;
+    },
+  },
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 64 - 0
src/views/markets/modules/BusMarketCouponsUsedListModal.vue

@@ -0,0 +1,64 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-market-coupons-used-list :couponsId="couponsId" ref="modalCouponsUsedListModal"></bus-market-coupons-used-list>
+  </j-modal>
+</template>
+
+<script>
+  import BusMarketCouponsUsedList from "./BusMarketCouponsUsedList";
+  export default {
+    name: 'BusMarketCouponsUsedListModal',
+    components: {
+      BusMarketCouponsUsedList
+    },
+    props: {
+      couponsId: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        title:'',
+        width:1200,
+        visible: false,
+        disableSubmit: false,
+        // eventId:'',
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.modalCouponsUsedListModal.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.modalCouponsUsedListModal.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

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

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <bus-market-coupons-used-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></bus-market-coupons-used-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 BusMarketCouponsUsedForm from './BusMarketCouponsUsedForm'
+
+  export default {
+    name: 'BusMarketCouponsUsedModal',
+    components: {
+      BusMarketCouponsUsedForm
+    },
+    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/BusMarketCouponsUsedModal.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="关闭">
+    <bus-market-coupons-used-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-coupons-used-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMarketCouponsUsedForm from './BusMarketCouponsUsedForm'
+  export default {
+    name: 'BusMarketCouponsUsedModal',
+    components: {
+      BusMarketCouponsUsedForm
+    },
+    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>

+ 162 - 0
src/views/markets/modules/Provide/MobileForm.vue

@@ -0,0 +1,162 @@
+<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="num"
+            >
+              <a-input-number
+                v-model="model.num"
+                placeholder="请输入每人发放张数"
+                style="width: 50%"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24" v-for="(item, index) in model.mobiles" :key="index">
+            <a-form-model-item
+              :label="'手机号' + (index + 1)"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              :prop="`mobiles[${index}]`"
+              :rules="[
+                {
+                  required: true,
+                  message: '请输入手机号!',
+                  trigger: 'change',
+                },
+              ]"
+            >
+              <a-input
+                v-model="item.value"
+                placeholder="请输入手机号"
+                style="width: 50%"
+              ></a-input>
+              <a-icon
+                v-if="model.mobiles.length - 1 == index"
+                type="plus-circle"
+                class="dynamic-delete-button"
+                @click="puls()"
+              />
+              <a-icon
+                type="minus-circle"
+                style="color: #f56c6c"
+                class="dynamic-delete-button"
+                v-if="model.mobiles.length > 1"
+                @click="() => remove(index)"
+              />
+            </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: "MobileForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+    couponsId: {
+      type: String,
+      default: "",
+      required: true,
+    },
+  },
+  data() {
+    return {
+      model: { num: 1, mobiles: [{ value: "" }] },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 3 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        num: [{ required: true, message: "请输入每人发放张数!" }],
+      },
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    this.model.couponsId = this.couponsId;
+  },
+  methods: {
+    puls() {
+      this.model.mobiles.push({ value: "" });
+    },
+    remove(index) {
+      this.model.mobiles.splice(index, 1);
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          httpAction(
+            "/business/busMarketCouponsUsed/gainCouponsUsedToNoMember",
+            this.model,
+            "post"
+          )
+            .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 scoped>
+.dynamic-delete-button {
+  cursor: pointer;
+  position: relative;
+  top: 4px;
+  margin-left: 5px;
+  font-size: 18px;
+  color: #1890ff;
+  transition: all 0.3s;
+}
+.dynamic-delete-button:hover {
+  color: #777;
+}
+.dynamic-delete-button[disabled] {
+  cursor: not-allowed;
+  opacity: 0.5;
+}
+</style>

+ 320 - 0
src/views/markets/modules/Provide/UserList.vue

@@ -0,0 +1,320 @@
+<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="">
+              <j-input
+                placeholder="会员名称"
+                v-model="queryParam.user_name"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-item label="">
+              <j-input
+                placeholder="会员手机号"
+                v-model="queryParam.mobile"
+              ></j-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
+                @click="handleAdd"
+                type="primary"
+                icon="plus"
+                style="margin-left: 8px"
+                >发放</a-button
+              >
+
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- table区域-begin -->
+    <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="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 v-if="record.statusName!=='已作废'" @click="handleEdit(record)">作废</a>
+        </span>
+      </a-table>
+    </div>
+
+    <!-- <bus-market-coupons-used-generate-form-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></bus-market-coupons-used-generate-form-modal> -->
+  </a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import { mixinDevice } from "@/utils/mixin";
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+// import BusMarketCouponsUsedGenerateFormModal from "./BusMarketCouponsUsedGenerateFormModal";
+import { httpAction, getAction } from "@/api/manage";
+
+export default {
+  name: "BusMarketCouponsUsedList",
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    // BusMarketCouponsUsedGenerateFormModal,
+  },
+  props: {
+    couponsId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      description: "免房券领取使用表管理页面",
+      // 表头
+      columns: [
+        {
+          title: "券号",
+          align: "center",
+          dataIndex: "code",
+        },
+        {
+          title: "免房券名称",
+          align: "center",
+          dataIndex: "conponsName",
+        },
+        // {不知道这个金额是干啥用,数据库表中没加金额字段
+        //   title: "金额",
+        //   align: "center",
+        //   dataIndex: "",
+        // },
+        {
+          title: "姓名",
+          align: "center",
+          dataIndex: "userName",
+        },
+
+        {
+          title: "房间号",
+          align: "center",
+          dataIndex: "roomNumber",
+        },
+        {
+          title: "入住单号",
+          align: "center",
+          dataIndex: "checkedInNo",
+        },
+        {
+          title: "手机号",
+          align: "center",
+          dataIndex: "mobile",
+        },
+        {
+          title: "领取时间",
+          align: "center",
+          dataIndex: "gainTime",
+          customRender: function (text) {
+            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          },
+        },
+        {
+          title: "使用时间",
+          align: "center",
+          dataIndex: "usedTime",
+          customRender: function (text) {
+            return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
+          },
+        },
+        {
+          title: "状态",
+          align: "center",
+          dataIndex: "statusName",
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 147,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
+      url: {
+        list: "/business/busMarketCouponsUsed/list?couponsId=" + this.couponsId,
+        delete: "/business/busMarketCouponsUsed/delete",
+        deleteBatch: "/business/busMarketCouponsUsed/deleteBatch",
+        exportXlsUrl: "/business/busMarketCouponsUsed/exportXls",
+        importExcelUrl: "business/busMarketCouponsUsed/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+    };
+  },
+  created() {
+    this.getSuperFieldList();
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
+    },
+  },
+  methods: {
+    handleEdit(item) {
+      var that = this;
+      this.$confirm({
+        title: "确认作废",
+        content: "是否作废?",
+        onOk: function () {
+          httpAction(
+            "/business/busMarketCouponsUsed/voided",
+            { id: item.id },
+            "put"
+          )
+            .then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                item.statusName = "已作废";
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {});
+        },
+        onCancel: function () {},
+      });
+    },
+    initDictConfig() {},
+    getSuperFieldList() {
+      let fieldList = [];
+      fieldList.push({
+        type: "string",
+        value: "tenantId",
+        text: "关联租户",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "hotelId",
+        text: "关联酒店",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "couponsId",
+        text: "免房券id",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "code",
+        text: "券号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "int",
+        value: "status",
+        text: "状态 0未领取 1已领取 2已使用 3已作废",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "userid",
+        text: "会员id",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "userName",
+        text: "姓名",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "roomNumber",
+        text: "房间号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "checkedInNo",
+        text: "入住单号",
+        dictCode: "",
+      });
+      fieldList.push({
+        type: "string",
+        value: "mobile",
+        text: "手机号",
+        dictCode: "",
+      });
+      fieldList.push({ type: "date", value: "gainTime", text: "领取时间" });
+      fieldList.push({ type: "date", value: "usedTime", text: "使用时间" });
+      this.superFieldList = fieldList;
+    },
+    handleAdd() {
+
+    },
+  },
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 75 - 0
src/views/markets/modules/Provide/index.vue

@@ -0,0 +1,75 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <a-card :bordered="false">
+      <a-tabs default-active-key="1">
+        <a-tab-pane key="1">
+          <span slot="tab"> 会员 </span>
+          <!-- <user-list :couponsId="couponsId" ref="userList"></user-list> -->
+          会员功能开发中,请体验非会员...
+        </a-tab-pane>
+        <a-tab-pane key="2">
+          <span slot="tab"> 非会员 </span>
+          <mobile-form :couponsId="couponsId" ref="mobileForm" @ok="submitCallback" ></mobile-form>
+        </a-tab-pane>
+      </a-tabs>
+    </a-card>
+  </j-modal>
+</template>
+
+<script>
+import UserList from "./UserList";
+import MobileForm from "./MobileForm";
+export default {
+  components: {
+    UserList,
+    MobileForm,
+  },
+  props: {
+    couponsId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return { title: "", width: 1200, visible: false, disableSubmit: false };
+  },
+  methods: {
+    // add() {
+    //   this.visible = true;
+    // },
+    // edit(record) {
+    //   this.visible = true;
+    //   this.$nextTick(() => {
+    //     this.$refs.mobileForm.edit(record);
+    //   });
+    // },
+    close() {
+      this.$emit("close");
+      this.visible = false;
+    },
+    handleOk() {
+      this.$refs.mobileForm.submitForm();
+    },
+    submitCallback() {
+      console.log('submitCallback')
+      this.$emit("ok");
+      this.visible = false;
+    },
+    handleCancel() {
+      this.close();
+    },
+  },
+};
+</script>
+
+<style scoped>
+</style>

+ 5 - 5
src/views/settings/components/modules/BusMarketCouponsEventDetailForm.vue

@@ -124,7 +124,7 @@ export default {
   },
   data() {
     return {
-      model: { type: 1,eventId:'',couponsCashId:'' },
+      model: { type: 1, eventId: "", couponsCashId: undefined },
       labelCol: {
         xs: { span: 24 },
         sm: { span: 5 },
@@ -173,8 +173,8 @@ export default {
   methods: {
     typeChange(e) {
       this.coupons = [];
-      this.model.couponsCashId=''
-      if (e.target.value == 1) {
+      this.model.couponsCashId = undefined;
+      if (e.target.value == 3) {
         getBusMarketCouponsList({ pageNo: 1, pageSize: 100 }).then((res) => {
           if (res.success) {
             this.coupons = res.result.records;
@@ -191,14 +191,14 @@ export default {
       }
     },
     add(eventId) {
-      console.log("eventId2",eventId)
+      console.log("eventId2", eventId);
       this.modelDefault.eventId = eventId;
       this.edit(this.modelDefault);
     },
     edit(record) {
       this.model = Object.assign({}, record);
       this.visible = true;
-      if (this.model.type == 1) {
+      if (this.model.type == 3) {
         getBusMarketCouponsList({ pageNo: 1, pageSize: 100 }).then((res) => {
           if (res.success) {
             this.coupons = res.result.records;

+ 1 - 1
src/views/settings/components/modules/BusMarketCouponsEventDetailList.vue

@@ -175,7 +175,7 @@ export default {
     handleAdd() {
       console.log("eventId", this.eventId);
       this.$refs.modalForm.add(this.eventId);
-      this.$refs.modalForm.title = "新增2";
+      this.$refs.modalForm.title = "新增";
       this.$refs.modalForm.disableSubmit = false;
     },
     initDictConfig() {},

+ 962 - 4
src/views/settings/components/paramSettings.vue

@@ -1,13 +1,971 @@
 <template>
-    <div>参数配置</div>
+    <div>
+        <a-row :gutter="[10,16]">
+            <a-col :md="6" :sm="8">
+                <a-card>
+                    <div class="item">
+                        <div class="item_header">
+                            <div class="item_header_left">
+                                <div class="item_header_left_logo">
+                                    <img class="logo" src="~@/assets/eye.png">
+                                </div>
+                                <div class="item_header_left_title">
+                                    夜审
+                                </div>
+                            </div>
+                            <div class="item_header_right">
+                                <a-switch checked-children="自动" un-checked-children="手动" default-checked
+                                          v-model="nightTrialModel.autoCheck"
+                                          @change="e=>onNightTrialCheckChange(e)"/>
+                            </div>
+                        </div>
+                        <div class="item_content">
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">夜审时间</div>
+                                </div>
+                                <div class="row_right">
+                                    <a-time-picker :open.sync="open" v-model="nightTrialModel.setNightTrialTime" format="HH:mm:ss" style="width: 80%">
+                                        <a-button slot="addon" size="small" @click="handleNightTrialCancel">
+                                            取消
+                                        </a-button>
+                                        <a-button class="margin_left_6" slot="addon" size="small" type="primary" @click="handleNightTrialConfirm">
+                                            确定
+                                        </a-button>
+                                    </a-time-picker>
+                                </div>
+                            </div>
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">自动交班</div>
+                                </div>
+                                <div class="row_right">
+                                    <a-switch checked-children="已开" un-checked-children="已关" default-checked
+                                              v-model="nightTrialModel.autoHand"
+                                              @change="e=>onNightTrialHandChange(e)"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </a-card>
+            </a-col>
+            <a-col :md="6" :sm="8">
+                <a-card>
+                    <div class="item">
+                        <div class="item_header">
+                            <div class="item_header_left">
+                                <div class="item_header_left_logo">
+                                    <img class="logo" src="~@/assets/clear.png">
+                                </div>
+                                <div class="item_header_left_title">
+                                    清扫房间选择服务员
+                                </div>
+                            </div>
+                            <div class="item_header_right">
+
+                            </div>
+                        </div>
+                        <div class="item_content">
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">清扫房间选择服务员</div>
+                                </div>
+                                <div class="row_right_1">
+                                    <a-switch checked-children="开启" un-checked-children="关闭" default-checked
+                                              v-model="clearModel.status"
+                                              @change="e=>onClearChange(e)"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </a-card>
+            </a-col>
+            <a-col :md="6" :sm="8">
+                <a-card>
+                    <div class="item">
+                        <div class="item_header">
+                            <div class="item_header_left">
+                                <div class="item_header_left_logo">
+                                    <img class="logo" src="~@/assets/clear.png">
+                                </div>
+                                <div class="item_header_left_title">
+                                    房务管理
+                                </div>
+                            </div>
+                            <div class="item_header_right">
+
+                            </div>
+                        </div>
+                        <div class="item_content">
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">开启房务管理功能</div>
+                                </div>
+                                <div class="row_right_1">
+                                    <a-switch checked-children="开启" un-checked-children="关闭" default-checked
+                                              v-model="houseSettingModel.status"
+                                              @change="e=>onHouseSettingChange(e)"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </a-card>
+            </a-col>
+            <a-col :md="6" :sm="8">
+                <a-card>
+                    <div class="item">
+                        <div class="item_header">
+                            <div class="item_header_left">
+                                <div class="item_header_left_logo">
+                                    <img class="logo" src="~@/assets/clear.png">
+                                </div>
+                                <div class="item_header_left_title">
+                                    押金设置
+                                </div>
+                            </div>
+                            <div class="item_header_right">
+                                <div v-show="show_deposit">
+                                    <a-button type="primary" shape="circle" icon="check" size="small"
+                                              @click="handleDepositConfirm">
+                                    </a-button>
+                                    <a-button class="margin_left_6" type="danger" shape="circle" icon="close" size="small"
+                                              @click="handleDepositCancel">
+                                    </a-button>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="item_content">
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">计算公式</div>
+                                </div>
+                                <div class="row_right">
+                                    <a-radio-group :value="depositModel.type" @change="handleDepositChange">
+                                        <a-radio-button value="1">
+                                            乘法
+                                        </a-radio-button>
+                                        <a-radio-button value="2">
+                                            加法
+                                        </a-radio-button>
+                                        <a-radio-button value="3">
+                                            固定
+                                        </a-radio-button>
+                                    </a-radio-group>
+                                </div>
+                            </div>
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">押金=</div>
+                                </div>
+                                <div class="row_right">
+                                    <div class="row_right_tip" v-show="depositModel.type != 3">
+                                        <span class="margin_right_4">房费</span>
+                                        <span class="margin_right_4">{{depositModel.formula}}</span>
+                                    </div>
+                                    <a-input-number v-show="depositModel.type == 1" :precision="2"
+                                                    @change="onDepositChange()"
+                                                    v-model="depositModel.multiple" :min="0" :max="999999" />
+                                    <a-input-number v-show="depositModel.type != 1" :precision="2"
+                                                    @change="onDepositChange()"
+                                                    v-model="depositModel.money" :min="0" :max="999999" />
+                                </div>
+                            </div>
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">余额报警</div>
+                                </div>
+                                <div class="row_right">
+                                    <a-switch checked-children="已开" un-checked-children="已关" default-checked
+                                              v-model="depositModel.alarm"
+                                              @change="e=>onDepositAlarmChange(e)"/>
+                                </div>
+                            </div>
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">余额小于</div>
+                                </div>
+                                <div class="row_right">
+                                    <a-input-number :precision="2" v-model="depositModel.less" :min="0" :max="999999"
+                                                    @change="onDepositChange()" />
+                                    <div class="margin_left_6">时报警</div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </a-card>
+            </a-col>
+            <a-col :md="6" :sm="8">
+                <a-card>
+                    <div class="item">
+                        <div class="item_header">
+                            <div class="item_header_left">
+                                <div class="item_header_left_logo">
+                                    <img class="logo" src="~@/assets/clear.png">
+                                </div>
+                                <div class="item_header_left_title">
+                                    撤销入住
+                                </div>
+                            </div>
+                            <div class="item_header_right">
+                                <div v-show="show_cancel">
+                                    <a-button type="primary" shape="circle" icon="check" size="small"
+                                              @click="handleCancelConfirm">
+                                    </a-button>
+                                    <a-button class="margin_left_6" type="danger" shape="circle" icon="close" size="small"
+                                              @click="handleCancelCancel">
+                                    </a-button>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="item_content">
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">撤销开关</div>
+                                </div>
+                                <div class="row_right">
+                                    <a-switch checked-children="已开" un-checked-children="已关" default-checked
+                                              v-model="cancelModel.status"
+                                              @change="e=>onCancelStatusChange(e)"/>
+                                </div>
+                            </div>
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">有效分钟</div>
+                                </div>
+                                <div class="row_right">
+                                    <a-input-number :precision="2" v-model="cancelModel.minute" :min="0" :max="999999"
+                                                    @change="onCancelChange()" />
+                                    <div class="margin_left_6">内可撤</div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </a-card>
+            </a-col>
+            <a-col :md="6" :sm="8">
+                <a-card>
+                    <div class="item">
+                        <div class="item_header">
+                            <div class="item_header_left">
+                                <div class="item_header_left_logo">
+                                    <img class="logo" src="~@/assets/clear.png">
+                                </div>
+                                <div class="item_header_left_title">
+                                    其他
+                                </div>
+                            </div>
+                            <div class="item_header_right">
+
+                            </div>
+                        </div>
+                        <div class="item_content">
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">是否显示制卡</div>
+                                </div>
+                                <div class="row_right_1">
+                                    <a-switch checked-children="开启" un-checked-children="关闭" default-checked
+                                              v-model="roomCardModel.status"
+                                              @change="e=>onRoomCardChange(e)"/>
+                                </div>
+                            </div>
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">是否开启会员验证</div>
+                                </div>
+                                <div class="row_right_1">
+                                    <a-switch checked-children="开启" un-checked-children="关闭" default-checked
+                                              v-model="memberVerifyModel.status"
+                                              @change="e=>onMemberVerifyChange(e)"/>
+                                </div>
+                            </div>
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">空脏房可以入住</div>
+                                </div>
+                                <div class="row_right_1">
+                                    <a-switch checked-children="开启" un-checked-children="关闭" default-checked
+                                              v-model="emptyDirtyRoomModel.status"
+                                              @change="e=>onEmptyDirtyRoomChange(e)"/>
+                                </div>
+                            </div>
+                            <div class="item_content_row">
+                                <div class="row_left">
+                                    <div class="row_left_tip">查房完毕才能退房</div>
+                                </div>
+                                <div class="row_right_1">
+                                    <a-switch checked-children="开启" un-checked-children="关闭" default-checked
+                                              v-model="checkOutModel.status"
+                                              @change="e=>onCheckOutChange(e)"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </a-card>
+            </a-col>
+        </a-row>
+    </div>
 </template>
 
 <script>
+    import { httpAction, getAction } from '@/api/manage'
+    import moment from 'moment';
     export default {
-        name: "paramSettings"
+        name: "paramSettings",
+        data () {
+            return {
+                labelCol: {
+                    xs: { span: 24 },
+                    sm: { span: 6 },
+                },
+                wrapperCol: {
+                    xs: { span: 24 },
+                    sm: { span: 12 },
+                },
+                url:{
+                    query_nighttrial:'/business/busNightTrial/queryByHotelId',
+                    nighttrial_autocheck:'/business/busNightTrial/editAutoCheck',
+                    nighttrial_time:'/business/busNightTrial/editNightTrialTime',
+                    nighttrial_autohand:'/business/busNightTrial/editAutoHand',
+                    query_clear:'/business/busClear/queryByHotelId',
+                    clear_status:'/business/busClear/editStatus',
+                    query_housesetting:'/business/busHouseSetting/queryByHotelId',
+                    housesetting_status:'/business/busHouseSetting/editStatus',
+                    query_deposit:'/business/busDepositSetting/queryByHotelId',
+                    deposit_edit:'/business/busDepositSetting/editInfo',
+                    query_cancel:'/business/busCancel/queryByHotelId',
+                    cancel_edit:'/business/busCancel/editInfo',
+                    query_roomcard:'/business/busOtherRoomCard/queryByHotelId',
+                    roomcard_status:'/business/busOtherRoomCard/editStatus',
+                    query_memberverify:'/business/busOtherMemberVerify/queryByHotelId',
+                    memberverify_status:'/business/busOtherMemberVerify/editStatus',
+                    query_emptydirtyroom:'/business/busOtherEmptyDirtyRoom/queryByHotelId',
+                    emptydirtyroom_status:'/business/busOtherEmptyDirtyRoom/editStatus',
+                    query_checkout:'/business/busOtherCheckout/queryByHotelId',
+                    checkout_status:'/business/busOtherCheckout/editStatus',
+                },
+                hotelId:'',
+                open: false,
+                nightTrialModel:{
+                    setNightTrialTime:moment('06:00:00','HH:mm:ss'),
+                    autoCheck:true,
+                    autoHand:true
+                },
+                clearModel:{
+                    status:true
+                },
+                houseSettingModel:{
+                    status:true
+                },
+                show_deposit:false,
+                depositModel:{
+                    type:'1',
+                    formula:'+',
+                    money:100,
+                    alarm:true,
+                    alarmValue:1,
+                    less:10.00,
+                    multiple:0.5,
+                },
+                show_cancel:false,
+                cancelModel:{
+                    status:true,
+                    statusValue:1,
+                    minute:60
+                },
+                roomCardModel:{
+                    status:true
+                },
+                memberVerifyModel:{
+                    status:true
+                },
+                emptyDirtyRoomModel:{
+                    status:true
+                },
+                checkOutModel:{
+                    status:true
+                },
+            }
+        },
+        created () {
+            //备份model原始值
+            this.initConfig()
+
+            var info = JSON.parse(localStorage.getItem("storeInfo"));
+            this.hotelId = info.id;
+        },
+        methods:{
+            initConfig(){
+                // 获取夜审信息
+                getAction(this.url.query_nighttrial,{}).then((res)=>{
+                    console.log(res)
+                    if(res.success){
+                        // this.nightTrialModel = res.result
+                        var _time = moment(res.result.setNightTrialTime,'HH:mm:ss')
+                        var _model = {
+                            id:res.result.id,
+                            autoCheck:res.result.autoCheck == 1?true:false,
+                            autoHand:res.result.autoHand == 1?true:false,
+                            setNightTrialTime : _time
+                        }
+                        this.nightTrialModel = _model
+                    }else{
+
+                    }
+                });
+
+                // 获取清扫信息
+                getAction(this.url.query_clear,{}).then((res)=>{
+                    if(res.success){
+                        var _model = {
+                            id:res.result.id,
+                            status:res.result.status == 1?true:false,
+                        }
+                        this.clearModel = _model
+                    }else{
+
+                    }
+                });
+
+                // 获取房务管理信息
+                getAction(this.url.query_housesetting,{}).then((res)=>{
+                    if(res.success){
+                        var _model = {
+                            id:res.result.id,
+                            status:res.result.status == 1?true:false,
+                        }
+                        this.houseSettingModel = _model
+                    }else{
+
+                    }
+                });
+
+                // 获取押金设置
+                getAction(this.url.query_deposit,{}).then((res)=>{
+                    if(res.success){
+                        var _data = res.result;
+                        var _formula = _data.depositType == 1 ?'x':'+';
+                        var _model = {
+                            id:_data.id,
+                            type:_data.depositType+'',
+                            formula:_formula,
+                            multiple:_data.depositMultiple,
+                            money:_data.depositMoney,
+                            alarm:_data.balanceAlarm == 1?true:false,
+                            alarmValue:_data.balanceAlarm,
+                            less:_data.balanceLess,
+                        }
+                        this.depositModel = _model
+                    }else{
+
+                    }
+                });
+
+                // 获取撤销入住信息
+                getAction(this.url.query_cancel,{}).then((res)=>{
+                    if(res.success){
+                        var _model = {
+                            id:res.result.id,
+                            status:res.result.status == 1?true:false,
+                            minute:res.result.minute
+                        }
+                        this.cancelModel = _model
+                    }else{
+
+                    }
+                });
+
+                //获取其他信息
+                //制卡
+                getAction(this.url.query_roomcard,{}).then((res)=>{
+                    if(res.success){
+                        var _model = {
+                            id:res.result.id,
+                            status:res.result.status == 1?true:false,
+                        }
+                        this.roomCardModel = _model
+                    }else{
+
+                    }
+                });
+                //会员验证
+                getAction(this.url.query_memberverify,{}).then((res)=>{
+                    if(res.success){
+                        var _model = {
+                            id:res.result.id,
+                            status:res.result.status == 1?true:false,
+                        }
+                        this.memberVerifyModel = _model
+                    }else{
+
+                    }
+                });
+                //空脏房
+                getAction(this.url.query_emptydirtyroom,{}).then((res)=>{
+                    if(res.success){
+                        var _model = {
+                            id:res.result.id,
+                            status:res.result.status == 1?true:false,
+                        }
+                        this.emptyDirtyRoomModel = _model
+                    }else{
+
+                    }
+                });
+                //退房
+                getAction(this.url.query_checkout,{}).then((res)=>{
+                    if(res.success){
+                        var _model = {
+                            id:res.result.id,
+                            status:res.result.status == 1?true:false,
+                        }
+                        this.checkOutModel = _model
+                    }else{
+
+                    }
+                });
+            },
+            onNightTrialCheckChange(val){
+                console.log('夜审'+val)
+                var _value = 0;
+                if (val){
+                    // 自动
+                    _value = 1;
+                }
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.nightTrialModel.id?this.nightTrialModel.id:'';
+                var param = {
+                    autoCheck :_value,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+
+                httpAction(this.url.nighttrial_autocheck,param,'post').then((res)=>{
+
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.nightTrialModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            handleOpenChange(open) {
+                console.log('open', open);
+                this.open = open;
+            },
+            handleNightTrialCancel() {
+                this.open = false;
+            },
+            handleNightTrialConfirm() {
+                this.open = false;
+                this.confirmLoading = true;
+                var that = this;
+                var _time = moment(new Date(this.nightTrialModel.setNightTrialTime)).format('HH:mm:ss');
+                var _id = this.nightTrialModel.id?this.nightTrialModel.id:'';
+                var param = {
+                    setNightTrialTime :_time,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+                httpAction(this.url.nighttrial_time,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.nightTrialModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            onNightTrialHandChange(val){
+                console.log('夜审'+val)
+                var _value = 0;
+                if (val){
+                    // 自动
+                    _value = 1;
+                }
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.nightTrialModel.id?this.nightTrialModel.id:'';
+                var param = {
+                    autoHand :_value,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+
+                httpAction(this.url.nighttrial_autohand,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.nightTrialModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            onClearChange(val){
+                var _value = 0;
+                if (val){
+                    // 开启
+                    _value = 1;
+                }
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.clearModel.id?this.clearModel.id:'';
+                var param = {
+                    status :_value,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+
+                httpAction(this.url.clear_status,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.clearModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            onHouseSettingChange(val){
+                var _value = 0;
+                if (val){
+                    // 开启
+                    _value = 1;
+                }
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.houseSettingModel.id?this.houseSettingModel.id:'';
+                var param = {
+                    status :_value,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+
+                httpAction(this.url.housesetting_status,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.houseSettingModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            handleDepositChange(e){
+                console.log(e.target.value)
+                var _type = e.target.value;
+                this.depositModel.type = _type;
+                this.show_deposit = true;
+                if (_type == 1){
+                    this.depositModel.formula = 'x'
+                }
+                if (_type == 2){
+                    this.depositModel.formula = '+'
+                }
+            },
+            handleDepositCancel(){
+                this.show_deposit = false;
+            },
+            handleDepositConfirm(){
+                // 押金设置提交
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.depositModel.id?this.depositModel.id:'';
+                var param = {
+                    hotelId:this.hotelId,
+                    id:_id,
+                    depositType:this.depositModel.type,
+                    depositMultiple:this.depositModel.multiple,
+                    depositMoney:this.depositModel.money,
+                    balanceAlarm:this.depositModel.alarmValue,
+                    balanceLess:this.depositModel.less,
+                }
+
+                httpAction(this.url.deposit_edit,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.depositModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                    that.show_deposit = false;
+                })
+            },
+            onDepositChange(){
+                this.show_deposit = true;
+            },
+            onDepositAlarmChange(val){
+                this.show_deposit = true;
+                var _value = 0;
+                if (val){
+                    // 自动
+                    _value = 1;
+                }
+                this.depositModel.alarmValue = _value;
+            },
+            onCancelChange(){
+                this.show_cancel = true;
+            },
+            onCancelStatusChange(val){
+                this.show_cancel = true;
+                var _value = 0;
+                if (val){
+                    // 自动
+                    _value = 1;
+                }
+                this.cancelModel.statusValue = _value;
+            },
+            handleCancelCancel(){
+                this.show_cancel = false;
+            },
+            handleCancelConfirm(){
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.cancelModel.id?this.cancelModel.id:'';
+                var param = {
+                    hotelId:this.hotelId,
+                    id:_id,
+                    status:this.cancelModel.statusValue,
+                    minute:this.cancelModel.minute,
+                }
+
+                httpAction(this.url.cancel_edit,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.cancelModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                    that.show_cancel = false;
+                })
+            },
+            onRoomCardChange(val){
+                var _value = 0;
+                if (val){
+                    // 开启
+                    _value = 1;
+                }
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.roomCardModel.id?this.roomCardModel.id:'';
+                var param = {
+                    status :_value,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+
+                httpAction(this.url.roomcard_status,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.roomCardModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            onMemberVerifyChange(val){
+                var _value = 0;
+                if (val){
+                    // 开启
+                    _value = 1;
+                }
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.memberVerifyModel.id?this.memberVerifyModel.id:'';
+                var param = {
+                    status :_value,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+
+                httpAction(this.url.memberverify_status,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.memberVerifyModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            onEmptyDirtyRoomChange(val){
+                var _value = 0;
+                if (val){
+                    // 开启
+                    _value = 1;
+                }
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.emptyDirtyRoomModel.id?this.emptyDirtyRoomModel.id:'';
+                var param = {
+                    status :_value,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+
+                httpAction(this.url.emptydirtyroom_status,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.emptyDirtyRoomModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+            onCheckOutChange(val){
+                var _value = 0;
+                if (val){
+                    // 开启
+                    _value = 1;
+                }
+                this.confirmLoading = true;
+                var that = this;
+                var _id = this.checkOutModel.id?this.checkOutModel.id:'';
+                var param = {
+                    status :_value,
+                    hotelId:this.hotelId,
+                    id:_id
+                }
+
+                httpAction(this.url.checkout_status,param,'post').then((res)=>{
+                    if(res.success){
+                        that.$message.success('操作成功');
+                        that.$emit('ok');
+                        that.checkOutModel.id = res.result.id
+                    }else{
+                        that.$message.warning(res.message);
+                    }
+                }).finally(() => {
+                    that.confirmLoading = false;
+                })
+            },
+        }
     }
 </script>
 
-<style scoped>
-
+<style lang="less" scoped>
+    .item{
+        text-align: center;
+        height: 220px;
+        margin-bottom: 10px;
+    }
+    .item_header{
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+        justify-items: center;
+        justify-content: center;
+    }
+    .item_header_left{
+        flex: 3;
+        display: flex;
+        flex-direction: row;
+    }
+    .item_header_left_logo{
+        flex: 1;
+    }
+    .item_header_left_logo .logo{
+        width: 32px;
+        height: 32px;
+        max-height: 50px;
+        max-width: 50px;
+    }
+    .item_header_left_title{
+        flex: 2;
+        font-size: 14px;
+        font-weight: bold;
+        color: black;
+        display: flex;
+        align-items: center;
+    }
+    .item_header_right{
+        flex: 2;
+    }
+    .item_content{
+        padding-top: 15px;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-items: center;
+        font-size: 14px;
+    }
+    .item_content_row{
+        width: 90%;
+        display: flex;
+        flex-direction: row;
+        padding-bottom: 12px;
+    }
+    .row_left{
+        flex: 1;
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+    }
+    .row_left_tip{
+        flex: 1;
+    }
+    .row_right{
+        flex: 2;
+        text-align: left;
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+    }
+    .row_right_1{
+        flex: 1;
+        text-align: left;
+    }
+    .row_right_tip{
+        display: flex;
+        align-items: center;
+    }
+    .row_middle{
+        flex: 1;
+    }
+    .row_right {
+        /deep/ .ant-time-picker-panel-addon{
+            text-align: right;
+        }
+    }
+    .margin_left_6{
+        margin-left: 6px;
+    }
+    .margin_left_4{
+        margin-left: 4px;
+    }
+    .margin_right_4{
+        margin-right: 4px;
+    }
+    /*.ant-time-picker-panel-addon{*/
+    /*    text-align: right;*/
+    /*}*/
 </style>

+ 53 - 0
src/views/settings/components/roomModules/RoomLayoutFormDetailModal.vue

@@ -0,0 +1,53 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-market-member-form ref="detailForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-member-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMarketMemberForm from './roomLayoutDetailForm'
+  export default {
+    name: 'BusMarketMemberDetailModal',
+    components: {
+      BusMarketMemberForm
+    },
+    data () {
+      return {
+        title:'详细设置',
+        raw: null,
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      setRaw(item) {
+        this.$nextTick(()=>{
+          setTimeout(()=>{
+            this.$refs.detailForm.setRaw(item)
+          },500)
+          
+        });
+        },
+        handleOk() {
+
+        },
+        handleCancel() {
+          this.visible = false
+
+        },
+        submitCallback() {
+          
+        }
+    }
+  }
+</script>

+ 23 - 17
src/views/settings/components/roomModules/RoomLayoutPriceModal.vue

@@ -1,28 +1,31 @@
 <template>
-    <j-modal :title="raw ? ('[' + raw.name + ']-->房价管理') : '房价管理'" :width="width" :visible="visible" switchFullscreen @ok="handleOk"
-        :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
-        <a-tabs
-        default-active-key="1"
-        tab-position="left"
-      >
-        <a-tab-pane  tab="全天房" key="1">
-            <room-qtf-price-table v-if="raw" :layout-id="raw.id"></room-qtf-price-table>
-        </a-tab-pane>
-        <a-tab-pane  tab="钟点房" key="2">
-222
-        </a-tab-pane>
-      </a-tabs>
+    <j-modal :title="raw ? ('[' + raw.name + ']-->房价管理') : '房价管理'" :width="width" :visible="visible" switchFullscreen
+        @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel"
+        cancelText="关闭">
+        <a-tabs default-active-key="1" tab-position="left" @change="ontabChange">
+            <a-tab-pane tab="全天房" key="1">
+                <room-qtf-price-table v-if="raw && tabCurrent == '1'" :layout-id="raw.id"></room-qtf-price-table>
+            </a-tab-pane>
+            <a-tab-pane tab="钟点房" key="2">
+                <room-zdf-price-table v-if="raw && tabCurrent == '2'" :layout-id="raw.id"></room-zdf-price-table>
+               
+            </a-tab-pane>
+        </a-tabs>
     </j-modal>
 </template>
 
 <script>
 import RoomQtfPriceTable from './RoomQtfPriceTable.vue';
+import RoomZdfPriceTable from './RoomZdfPriceTable.vue'
+
 export default {
-    components:{
-        RoomQtfPriceTable
+    components: {
+        RoomQtfPriceTable,
+        RoomZdfPriceTable
     },
     data() {
         return {
+            tabCurrent: '1',
             width: '90%',
             visible: false,
             disableSubmit: false,
@@ -31,13 +34,16 @@ export default {
     },
 
     mounted() {
-        
+
     },
 
     methods: {
         handleOk() {
             console.log(1)
         },
+        ontabChange(e) {
+            this.tabCurrent = e
+        },
         handleCancel() {
             this.visible = false
         },
@@ -52,6 +58,6 @@ export default {
 };
 </script>
 
-<style lang="stylus" scoped>
+<style  scoped>
 
 </style>

+ 171 - 50
src/views/settings/components/roomModules/RoomQtfPriceTable.vue

@@ -1,5 +1,5 @@
 <template>
-    <div >
+    <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"
@@ -26,7 +26,8 @@
                 </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-input-number style="width:100%;" v-model="model.oprice" :min="1" placeholder="请填写原价"
+                            @change="formVipOpriceChange" />
                     </a-form-model-item>
                 </a-col>
                 <a-col :span="3">
@@ -35,7 +36,7 @@
                     </a-form-model-item>
                 </a-col>
                 <a-col :span="3">
-                    <a-form-model-item label="预付"  prop="prepay">
+                    <a-form-model-item label="预付" prop="prepay">
                         <a-radio-group v-model="model.prepay">
                             <a-radio-button :value="1">
@@ -69,7 +70,10 @@
                     </a-form-model-item>
                 </a-col>
                 <a-col :span="1">
-                    <a-button @click="submitForm" type="primary">保存</a-button>
+                    <a-button :disabled="submitLoading" :loading="submitLoading" @click="submitForm" type="primary">保存</a-button>
+                </a-col>
+                <a-col :span="1">
+                    <a-button :disabled="submitLoading" :loading="submitLoading" @click="clearForm" type="primary">清空</a-button>
                 </a-col>
             </a-row>
         </a-form-model>
@@ -84,13 +88,16 @@
             <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)"/>
+                    <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)"/>
+                    <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)"/>
+                    <a-input-number style="width:80%;" :value="item.price" :min="0" placeholder="请填写现价"
+                        @change="vipPriceChange($event, item)" />
                 </div>
             </div>
         </div>
@@ -98,9 +105,11 @@
 </template>
 
 <script>
-import { list } from '@/api/roomLayoutPrice'
+import { list, modify, create, getLayoutpriceLevels } from '@/api/roomLayoutPrice'
 import { httpAction, getAction } from "@/api/manage";
 import * as api from '@/api/api'
+import { find } from 'lodash';
+import json5 from 'json5';
 const columns = [
     {
         title: '房价名称',
@@ -152,6 +161,7 @@ export default {
     },
     data() {
         return {
+            submitLoading: false,
             labelCol: {
                 xs: { span: 24 },
                 sm: { span: 10 },
@@ -190,39 +200,65 @@ export default {
     mounted() {
         this.getData()
         this.getVipLevels()
+
     },
     methods: {
+        clearForm() {
+            this.model = {
+                id: '',
+                name: '',
+                oprice: null,
+                price: null,
+                prepay: 0,
+                integral: 0,
+                num: 0,
+                isVip: 0
+            }
+            this.vipLevels = JSON.parse(JSON.stringify(this.origiVipLevels))
+        },
         vipPriceChange(e, item) {
-            if(this.model.oprice) {
+            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)
+            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)
+            if (item.discount) {
+                item.price = (this.model.oprice * (item.discount / 100)).toFixed(2)
             }
             this.model.oprice = e
         },
+        formVipOpriceChange(e) {
+            (this.vipLevels || []).forEach(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=>{
+                if (res.result && res.result.records) {
+
+                    res.result.records.forEach(s => {
                         s['price'] = 0
-                        if(!s.discount) {
+                        // 保存原有折扣率
+                        s['ldiscount'] = s.discount
+                        if (!s.discount) {
                             s.discount = 100
                         }
+
+
                     })
                     this.origiVipLevels = res.result.records
                     this.vipLevels = JSON.parse(JSON.stringify(res.result.records))
@@ -233,15 +269,48 @@ export default {
 
         },
         onVipChange(e) {
-            if(this.model.isVip) {
+            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
+            this.getRelationLevels(record.id, (rLevels) => {
+
+                let cpData = JSON.parse(JSON.stringify(record))
+                cpData.isVip = record.isVip ? 1 : 0
+                cpData.prepay = record.prepay ? 1 : 0
+                this.model = cpData
+                let nowLvs = JSON.parse(JSON.stringify(this.origiVipLevels))
+                if (this.model.oprice) {
+                    nowLvs.forEach(s => {
+                        if (rLevels) {
+                            let findIndex = rLevels.findIndex(q => q.levelId == s.id)
+                            if (findIndex > -1) {
+                                s.discount = rLevels[findIndex].discount
+                                s['memberPriceId'] = rLevels[findIndex].id
+                            } else {
+                                s['memberPriceId'] = ''
+                            }
+                        }
+                        s.price = (this.model.oprice * (s.discount / 100)).toFixed(2)
+                    })
+                }
+                this.vipLevels = nowLvs
+            })
+
+
+        },
+        getRelationLevels(pid, callback) {
+            getLayoutpriceLevels({
+                parentId: pid
+            }).then(res => {
+                // 关联折扣等级
+                let rLevels = []
+                if (res.code == 200 && res.result.length > 0) {
+                    rLevels = res.result
+                }
+                callback(rLevels)
+            })
         },
         getData() {
             this.loading = true
@@ -268,53 +337,105 @@ export default {
             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;
-                    //     });
+                    if (this.model.id && this.model.id != '') {
+                        this.doModify()
+                    } else {
+                        this.doCreate()
+                    }
                 }
             });
         },
+        doModify() {
+            let model = JSON.parse(JSON.stringify(this.model))
+            model['hotelId'] = hotelItem.id
+            model['layoutId'] = this.layoutId
+            model['type'] = 1
+
+            let memberPriceEntities = [];
+            if (model.isVip) {
+                (this.vipLevels || []).forEach(s => {
+                    let item = {
+                        id: s.memberPriceId,
+                        levelId: s.id,
+                        discount: parseFloat(s.discount || 100),
+                        ldiscount: parseFloat(s.ldiscount || 100),
+                    }
+                    memberPriceEntities.push(item)
+                })
+            }
+
+            model['memberPriceEntities'] = memberPriceEntities
+
+            this.submitLoading = true
+            modify(model).then(s => {
+                if (s.code == 200) {
+                    this.$message.success("保存成功")
+                    this.clearForm()
+                    this.getData()
+                }
+            }).catch(err => {
+                this.$message.error("保存失败")
+            }).finally(_ => {
+                this.submitLoading = false
+            })
+        },
+        doCreate() {
+            
+            let model = JSON.parse(JSON.stringify(this.model))
+            model['hotelId'] = hotelItem.id
+            model['layoutId'] = this.layoutId
+            model['type'] = 1
+            let memberPriceEntities = [];
+            if (model.isVip) {
+                (this.vipLevels || []).forEach(s => {
+                    let item = {
+                        levelId: s.id,
+                        hotelId: hotelItem.id,
+                        discount: parseFloat(s.discount || 100),
+                        ldiscount: parseFloat(s.ldiscount || 100),
+                    }
+                    memberPriceEntities.push(item)
+                })
+            }
+
+            model['memberPriceEntities'] = memberPriceEntities
+            this.submitLoading = true
+            create(model).then(s => {
+                if (s.code == 200) {
+                    this.$message.success("保存成功")
+                    this.clearForm()
+                    this.getData()
+                }
+            }).catch(err => {
+                this.$message.error("保存失败")
+            }).finally(_ => {
+                
+                this.submitLoading = false
+            })
+        }
 
     },
 };
 </script>
 
 <style lang="css" scoped>
-.vip-config{
+.vip-config {
     width: 30%;
     height: 200px;
     overflow-y: auto;
     margin-top: 20px;
 }
-.config-heads{
+
+.config-heads {
     display: flex;
 }
-.config-heads .head-item{
+
+.config-heads .head-item {
     flex: 1;
     text-align: left;
 }
-.h-title{
+
+.h-title {
     font-weight: 600;
 }
 </style>

+ 561 - 0
src/views/settings/components/roomModules/RoomZdfPriceTable.vue

@@ -0,0 +1,561 @@
+<template>
+    <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.isVip" />
+            </span>
+            <span slot="startDate" slot-scope="text, record, index">
+                {{ record.startDate }} ~ {{ record.endDate }}
+            </span>
+            
+            <span slot="sellerId" slot-scope="text, record, index">
+                {{ record.sellerId ? getSellerName(record.sellerId): '' }}
+            </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>
+                </a-popconfirm>
+            </span>
+        </a-table>
+        <a-form-model layout="inline" ref="form" :model="model" :rules="validatorRules" slot="detail">
+            <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="请填写原价"
+                            @change="formVipOpriceChange" />
+                    </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-row>
+            <a-row>
+                <a-col :span="4">
+                    <a-form-model-item label="适用时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startDate">
+                        <a-time-picker :open.sync="open2"  v-model="model.startDate" format="HH:mm" @change="onStartTimeChange">
+                            <a-button slot="addon" size="small" type="primary" @click="open2 = false">
+                              确定
+                            </a-button>
+                          </a-time-picker>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="3">
+                    <a-form-model-item label="" :labelCol="labelCol1" :wrapperCol="wrapperCol" prop="endDate">
+                        <a-time-picker :open.sync="open" v-model="model.endDate" format="HH:mm">
+                            <a-button slot="addon" size="small" type="primary" @click="open = false">
+                              确定
+                            </a-button>
+                          </a-time-picker>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="4">
+                    <a-form-model-item label="钟点房方案" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sellerId">
+                        <a-select style="width: 120px" v-model="model.sellerId" placeholder="请选择">
+                            <a-select-option :value="item.id" v-for="item in hourRules">
+                              {{ item.hourRoomName }}
+                            </a-select-option>
+                          </a-select>
+                    </a-form-model-item>
+                </a-col>
+                <a-col :span="2">
+                    <a-button :disabled="submitLoading" :loading="submitLoading" @click="submitForm" type="primary">保存</a-button>
+                </a-col>
+                <a-col :span="1">
+                    <a-button :disabled="submitLoading" :loading="submitLoading" @click="clearForm" 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>
+Date.prototype.Format = function (fmt) {
+        var o = {
+        "M+": this.getMonth() + 1, //月份
+        "d+": this.getDate(), //日
+        "H+": this.getHours(), //小时
+        "m+": this.getMinutes(), //分
+        "s+": this.getSeconds(), //秒
+        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+        "S": this.getMilliseconds() //毫秒
+        };
+        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+        for (var k in o)
+        if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+        return fmt;
+        }
+import { list, modify, create, getLayoutpriceLevels, getHourRoomRule } from '@/api/roomLayoutPrice'
+import { httpAction, getAction } from "@/api/manage";
+import * as api from '@/api/api'
+import { find } from 'lodash';
+import moment from 'moment';
+const columns = [
+    {
+        title: '房价名称',
+        dataIndex: 'name',
+        key: 'name',
+    },
+    {
+        title: '原价',
+        dataIndex: 'oprice',
+        key: 'oprice',
+    },
+    {
+        title: '现价',
+        dataIndex: 'price',
+        key: 'price',
+    },
+    {
+        title: '适用时段',
+        key: 'startDate',
+        dataIndex: 'startDate',
+        scopedSlots: { customRender: 'startDate' },
+    },
+    {
+        title: '预付',
+        key: 'prepay',
+        dataIndex: 'prepay',
+        scopedSlots: { customRender: 'prepay' },
+    },
+
+    {
+        title: '积分',
+        dataIndex: 'integral',
+        key: 'integral',
+    },
+    {
+        title: '数量',
+        dataIndex: 'num',
+        key: 'num',
+    },
+    {
+        title: '使用会员折扣',
+        dataIndex: 'isVip',
+        key: 'isVip',
+        scopedSlots: { customRender: 'isVip' },
+    },
+    {
+        title: '钟点房方案',
+        key: 'sellerId',
+        dataIndex: 'sellerId',
+        scopedSlots: { customRender: 'sellerId' },
+    },
+    {
+        title: '操作',
+        key: 'action',
+        scopedSlots: { customRender: 'action' },
+    },
+];
+let hotelItem = JSON.parse(window.localStorage.getItem('storeInfo'))
+export default {
+    props: {
+        layoutId: null
+    },
+    data() {
+        return {
+            open: false,
+            open2: false,
+            submitLoading: false,
+            labelCol1: {
+                xs: { span: 0 },
+                sm: { span: 0 },
+            },
+            labelCol: {
+                xs: { span: 24 },
+                sm: { span: 10 },
+            },
+            wrapperCol: {
+                xs: { span: 24 },
+                sm: { span: 14 },
+            },
+            loading: false,
+            data: [],
+            columns,
+            searchType: 2,
+            validatorRules: {
+                name: [{ required: true, message: "请输入房价名称!" }],
+                oprice: [{ required: true, message: "请填写原价价!" }],
+                price: [{ required: true, message: "请填写现价!" }],
+                startDate: [{ required: true, message: "请选择适用开始时间" }],
+                endDate: [{ required: true, message: "请选择适用结束时间" }],
+                integral: [{ required: true, message: "请填写积分!" }],
+                lunchNum: [{ required: true, message: "请填写中餐数量!" }],
+                dinnerNum: [{ required: true, message: "请填写晚餐数量!" }],
+            },
+            model: {
+                id: '',
+                name: '',
+                oprice: null,
+                price: null,
+                prepay: 0,
+                integral: 0,
+                num: 0,
+                startDate: null,
+                endDate: null,
+                isVip: 0,
+                sellerId: null,
+            },
+            vipLevels: [],
+            origiVipLevels: [],
+            hourRules: []
+        };
+    },
+
+    mounted() {
+        this.getData()
+        this.getVipLevels()
+        this.getHourRoomRule()
+    },
+    methods: {
+        onStartTimeChange(e, timeStr) {
+            console.log(e,timeStr,this.model.startDate)
+        },
+        onEndTimeChange(e, timeStr) {
+            this.model.endDate = timeStr
+        },
+        getSellerName(id) {
+            let index = this.hourRules.findIndex(s=>s.id == id)
+            if(index > -1) {
+                return this.hourRules[index].hourRoomName
+            }
+            return id
+        },
+        clearForm() {
+            this.model = {
+                id: '',
+                name: '',
+                oprice: null,
+                price: null,
+                prepay: 0,
+                integral: 0,
+                startDate: null,
+                endDate: null,
+                sellerId: null,
+                num: 0,
+                isVip: 0
+            }
+            this.vipLevels = JSON.parse(JSON.stringify(this.origiVipLevels))
+        },
+        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
+        },
+        formVipOpriceChange(e) {
+            (this.vipLevels || []).forEach(item => {
+                if (item.discount) {
+                    item.price = (this.model.oprice * (item.discount / 100)).toFixed(2)
+                }
+            })
+            this.model.oprice = e
+        },
+        getHourRoomRule() {
+            getHourRoomRule({
+                pageNo: 1,
+                pageSize: 999
+            }).then(res => {
+                if(res.code == 200) {
+                    this.hourRules = res.result.records
+                } else {
+                    this.$message.warning('⚠️没有找到钟点房方案')
+                }
+            })
+        },
+        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
+                        // 保存原有折扣率
+                        s['ldiscount'] = s.discount
+                        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) {
+            this.getRelationLevels(record.id, (rLevels) => {
+
+                let cpData = JSON.parse(JSON.stringify(record))
+                cpData.isVip = record.isVip ? 1 : 0
+                cpData.prepay = record.prepay ? 1 : 0
+                this.model = cpData
+                this.model.startDate = moment(this.model.startDate,"HH:mm")
+                this.model.endDate = moment(this.model.endDate,"HH:mm")
+                let nowLvs = JSON.parse(JSON.stringify(this.origiVipLevels))
+                if (this.model.oprice) {
+                    nowLvs.forEach(s => {
+                        if (rLevels) {
+                            let findIndex = rLevels.findIndex(q => q.levelId == s.id)
+                            if (findIndex > -1) {
+                                s.discount = rLevels[findIndex].discount
+                                s['memberPriceId'] = rLevels[findIndex].id
+                            } else {
+                                s['memberPriceId'] = ''
+                            }
+                        }
+                        s.price = (this.model.oprice * (s.discount / 100)).toFixed(2)
+                    })
+                }
+                this.vipLevels = nowLvs
+            })
+
+
+        },
+        getRelationLevels(pid, callback) {
+            getLayoutpriceLevels({
+                parentId: pid
+            }).then(res => {
+                // 关联折扣等级
+                let rLevels = []
+                if (res.code == 200 && res.result.length > 0) {
+                    rLevels = res.result
+                }
+                callback(rLevels)
+            })
+        },
+        getData() {
+            this.loading = true
+            list({
+                type: this.searchType,
+                // hotelId: hotelItem.id,
+                roomLayoutId: this.layoutId,
+                pageNo: 1,
+                pageSize: 999
+            }).then(res => {
+                this.loading = false
+                console.log(res)
+                this.data = res.result.records
+            }).catch(res => {
+                this.loading = false
+            })
+        },
+        handleDelete(id) {
+
+        },
+        submitForm() {
+            const that = this;
+            // 触发表单验证
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    that.confirmLoading = true;
+                    if (this.model.id && this.model.id != '') {
+                        this.doModify()
+                    } else {
+                        this.doCreate()
+                    }
+                }
+            });
+        },
+        doModify() {
+            let model = JSON.parse(JSON.stringify(this.model))
+            model['hotelId'] = hotelItem.id
+            model['layoutId'] = this.layoutId
+            model['type'] = 2
+            model.startDate = this.model.startDate
+            model.endDate = this.model.endDate
+            model.startDate =model.startDate.utcOffset(8).format("HH:mm")
+            model.endDate = model.endDate.utcOffset(8).format("HH:mm")
+            let memberPriceEntities = [];
+            if (model.isVip) {
+                (this.vipLevels || []).forEach(s => {
+                    let item = {
+                        id: s.memberPriceId,
+                        levelId: s.id,
+                        discount: parseFloat(s.discount || 100),
+                        ldiscount: parseFloat(s.ldiscount || 100),
+                    }
+                    memberPriceEntities.push(item)
+                })
+            }
+
+            model['memberPriceEntities'] = memberPriceEntities
+
+            this.submitLoading = true
+            modify(model).then(s => {
+                if (s.code == 200) {
+                    this.$message.success("保存成功")
+                    this.clearForm()
+                    this.getData()
+                }
+            }).catch(err => {
+                this.$message.error("保存失败")
+            }).finally(_ => {
+                this.submitLoading = false
+            })
+        },
+        doCreate() {
+            
+            let model = JSON.parse(JSON.stringify(this.model))
+            model['hotelId'] = hotelItem.id
+            model['layoutId'] = this.layoutId
+            model['type'] = 2
+            // 经过序列化的moment要重新赋值成moment对象
+            model.startDate = this.model.startDate
+            model.endDate = this.model.endDate
+            model.startDate =model.startDate.utcOffset(8).format("HH:mm")
+            model.endDate = model.endDate.utcOffset(8).format("HH:mm")
+            let memberPriceEntities = [];
+            
+            if (model.isVip) {
+                (this.vipLevels || []).forEach(s => {
+                    let item = {
+                        levelId: s.id,
+                        hotelId: hotelItem.id,
+                        discount: parseFloat(s.discount || 100),
+                        ldiscount: parseFloat(s.ldiscount || 100),
+                    }
+                    memberPriceEntities.push(item)
+                })
+            }
+
+            model['memberPriceEntities'] = memberPriceEntities
+            this.submitLoading = true
+            create(model).then(s => {
+                if (s.code == 200) {
+                    this.$message.success("保存成功")
+                    this.clearForm()
+                    this.getData()
+                }
+            }).catch(err => {
+                this.$message.error("保存失败")
+            }).finally(_ => {
+                
+                this.submitLoading = false
+            })
+        }
+
+    },
+};
+</script>
+
+<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;
+}
+/deep/
+.ant-select-selection__placeholder, .ant-select-search__field__placeholder{
+    display: inline-block !important;
+}
+</style>

+ 165 - 0
src/views/settings/components/roomModules/roomLayoutDetailForm.vue

@@ -0,0 +1,165 @@
+<template>
+    <a-tabs default-active-key="1" @change="()=>{}">
+        <a-tab-pane key="1" tab="房型详情">
+          <detail></detail>
+        </a-tab-pane>
+        <a-tab-pane key="2" tab="设备服务">
+          <device></device>
+        </a-tab-pane>
+        <a-tab-pane key="3" tab="房型图片">
+          <layout-image></layout-image>
+        </a-tab-pane>
+      </a-tabs>
+</template>
+
+<script>
+import { getRoomPlans, getSelectList } from "@/api/api";
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+import detail from './roomLayoutDetailForm/roomLayoutDetail.vue'
+import device from './roomLayoutDetailForm/roomLayoutDevice.vue'
+import layoutImage from './roomLayoutDetailForm/roomLayoutImage.vue'
+
+export default {
+    name: "BusMarketMemberForm",
+    props: {
+        disabled: {
+            type: Boolean,
+            default: false,
+            required: false,
+        },
+    },
+    components: {
+        detail,
+        device,
+        layoutImage
+    },
+    data() {
+        return {
+            model: {
+                id: "",
+                hotelId: 0,
+                name: null,
+                marketPrice: null,
+                canLivePersonNum: 0,
+                breakfastNum: 0,
+                lunchNum: 0,
+                dinnerNum: 0
+            },
+            labelCol: {
+                xs: { span: 24 },
+                sm: { span: 5 },
+            },
+            wrapperCol: {
+                xs: { span: 24 },
+                sm: { span: 16 },
+            },
+            confirmLoading: false,
+            validatorRules: {
+                name: [{ required: true, message: "请输入房型!" }],
+                marketPrice: [{ required: true, message: "请填写门市价!" }],
+                canLivePersonNum: [{ required: true, message: "请填写可住人数!" }],
+                breakfastNum: [{ required: true, message: "请填写早餐数量!" }],
+                lunchNum: [{ required: true, message: "请填写中餐数量!" }],
+                dinnerNum: [{ required: true, message: "请填写晚餐数量!" }],
+            },
+            url: {
+                add: "/rooms/cesRoomLayout/save",
+                edit: "/rooms/cesRoomLayout/modify",
+                queryById: "/rooms/cesRoomLayout/queryById",
+            },
+            iconChooseVisible: false,
+            roomPlans: [],
+            members: [],
+        };
+    },
+    computed: {
+        formDisabled() {
+            return this.disabled;
+        },
+    },
+    created() {
+        var _info = JSON.parse(localStorage.getItem("storeInfo"));
+        if (_info) {
+            this.model.hotelId = _info.id;
+            this.initData();
+        }
+        this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+        setRaw(item) {
+            this.model = JSON.parse(JSON.stringify(item))
+        },
+        initData() {
+            getRoomPlans(this.model.hotelId, null).then((res) => {
+                if (res.success) {
+                    this.roomPlans = res.result;
+                }
+            });
+
+        },
+        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) {
+            this.model = Object.assign({}, record);
+            this.visible = true;
+            getSelectList({ id: this.model.id }).then((res) => {
+                if (res.success) {
+                    this.members = res.result;
+                }
+            });
+        },
+        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 scoped>
+.avatar-uploader>.ant-upload {
+    width: 104px;
+    height: 104px;
+}
+</style>

+ 36 - 0
src/views/settings/components/roomModules/roomLayoutDetailForm/roomLayoutDetail.vue

@@ -0,0 +1,36 @@
+<template>
+    <div>
+        <a-form-model ref="form" :model="model" :rules="validatorRules">
+            TODO:详情配置
+        </a-form-model>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'HotelSaasTenantFrontendRoomLayoutDetail',
+
+    data() {
+        return {
+            model: {
+
+            },
+            validatorRules: {
+
+            }
+        };
+    },
+
+    mounted() {
+        
+    },
+
+    methods: {
+        
+    },
+};
+</script>
+
+<style lang="stylus" scoped>
+
+</style>

+ 36 - 0
src/views/settings/components/roomModules/roomLayoutDetailForm/roomLayoutDevice.vue

@@ -0,0 +1,36 @@
+<template>
+    <div>
+        <a-form-model ref="form" :model="model" :rules="validatorRules">
+            TODO:房间配置
+        </a-form-model>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'HotelSaasTenantFrontendRoomLayoutDevice',
+
+    data() {
+        return {
+            model: {
+
+            },
+            validatorRules: {
+
+            }
+        };
+    },
+
+    mounted() {
+        
+    },
+
+    methods: {
+        
+    },
+};
+</script>
+
+<style lang="stylus" scoped>
+
+</style>

+ 36 - 0
src/views/settings/components/roomModules/roomLayoutDetailForm/roomLayoutImage.vue

@@ -0,0 +1,36 @@
+<template>
+    <div>
+        <a-form-model ref="form" :model="model" :rules="validatorRules">
+            TODO:房型大图
+        </a-form-model>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'HotelSaasTenantFrontendRoomLayoutImage',
+
+    data() {
+        return {
+            model: {
+
+            },
+            validatorRules: {
+
+            }
+        };
+    },
+
+    mounted() {
+        
+    },
+
+    methods: {
+        
+    },
+};
+</script>
+
+<style lang="stylus" scoped>
+
+</style>

+ 8 - 1
src/views/settings/components/roomModules/roomLayoutList.vue

@@ -82,7 +82,7 @@
                                 <a @click="handlePriceManager(record)">价格管理</a>
                             </a-menu-item>
                             <a-menu-item>
-                                <a @click="handleInfo(record)">价格管理</a>
+                                <a @click="handleDetailSetting(record)">详细设置</a>
                             </a-menu-item>
                             <a-menu-item>
                                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@@ -96,6 +96,7 @@
         </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 ref="detailModal"></room-layout-detail-modal>
     </a-card>
 </template>
   
@@ -103,6 +104,7 @@
 
 import { JeecgListMixin } from "@/mixins/JeecgListMixin";
 import roomLayoutForm from "./RoomLayoutFormModal"; // todo roomLayoutForm 需要替换成房型的表单弹窗
+import RoomLayoutDetailModal from "./RoomLayoutFormDetailModal.vue";
 
 import RoomLayoutPriceModal from "./RoomLayoutPriceModal.vue";
 
@@ -115,6 +117,7 @@ export default {
     components: {
         roomLayoutForm,
         RoomLayoutPriceModal,
+        RoomLayoutDetailModal
     },
     data() {
         return {
@@ -216,6 +219,10 @@ export default {
             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
+        },
         changeState(e) {
             console.log(e)
         },