gqx 2 lat temu
rodzic
commit
13902e89be

+ 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
     },

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

@@ -0,0 +1,327 @@
+<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="">
+              <j-input
+                placeholder="免房券名称"
+                v-model="queryParam.name"
+              ></j-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:value="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="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>
+  </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 { deleteAction } from "@/api/manage";
+export default {
+  name: "BusMarketCouponsList",
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    BusMarketCouponsModal,
+    BusMarketCouponsUsedListModal,
+  },
+  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: "tenantId",
+        },
+        {
+          title: "待领取",
+          align: "center",
+          dataIndex: "tenantId",
+        },
+        {
+          title: "已领取",
+          align: "center",
+          dataIndex: "tenantId",
+        },
+        {
+          title: "已使用",
+          align: "center",
+          dataIndex: "tenantId",
+        },
+        {
+          title: "已作废",
+          align: "center",
+          dataIndex: "tenantId",
+        },
+        {
+          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 () {},
+      });
+    },
+    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: 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() {
+      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>

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

@@ -174,7 +174,7 @@ export default {
     typeChange(e) {
       this.coupons = [];
       this.model.couponsCashId = undefined;
-      if (e.target.value == 1) {
+      if (e.target.value == 3) {
         getBusMarketCouponsList({ pageNo: 1, pageSize: 100 }).then((res) => {
           if (res.success) {
             this.coupons = res.result.records;
@@ -198,7 +198,7 @@ export default {
     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() {},