Explorar el Código

自动赠券模块

gqx hace 2 años
padre
commit
9aec100781

+ 5 - 1
src/api/api.js

@@ -100,6 +100,8 @@ const getBusMarketMemberLablList = (params)=>getAction(`/business/busMarketMembe
 const getBusMarketMemberGroupList = (params)=>getAction(`/business/busMarketMemberGroup/list`,params);
 const deleteMarketMemberGroup = (params)=>deleteAction("/business/busMarketMemberGroup/delete",params);
 const deleteMarketMemberLable = (params)=>deleteAction("/business/busMarketMemberLable/delete",params);
+const getBusMarketCouponsList = (params)=>getAction(`/business/busMarketCoupons/list`,params);
+const getBusMarketCouponsCashList = (params)=>getAction(`/business/busMarketCouponsCash/list`,params);
 // 中转HTTP请求
 export const transitRESTful = {
   get: (url, parameter) => getAction(getTransitURL(url), parameter),
@@ -169,7 +171,9 @@ export {
   getBusMarketMemberLablList,
   getBusMarketMemberGroupList,
   deleteMarketMemberGroup,
-  deleteMarketMemberLable
+  deleteMarketMemberLable,
+  getBusMarketCouponsList,
+  getBusMarketCouponsCashList
 }
 
 

+ 213 - 0
src/views/settings/components/BusMarketCouponsEventList.vue

@@ -0,0 +1,213 @@
+<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.name"
+                style="width: 200px"
+              ></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
+                type="primary"
+                @click="searchReset"
+                icon="reload"
+                style="margin-left: 8px"
+                >重置</a-button
+              >
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-button style="margin-left: 8px">
+          批量操作 <a-icon type="down"
+        /></a-button>
+      </a-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="timeslot" slot-scope="text, record, index">
+          {{ record.startTime + "~" + record.endTime }}
+        </template>
+        <template slot="stateslot" slot-scope="text, record, index">
+          {{ record.state == 1 ? "启用" : "禁用" }}
+        </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-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm
+                  title="确定删除吗?"
+                  @confirm="() => handleDelete(record.id)"
+                >
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+      </a-table>
+    </div>
+    <bus-market-coupons-event-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></bus-market-coupons-event-modal>
+    <bus-market-coupons-event-detail-list-modal
+      :eventId="eventId"
+      ref="modalCouponsEventDetailList"
+    ></bus-market-coupons-event-detail-list-modal>
+  </a-card>
+</template>
+  
+  <script>
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+import BusMarketCouponsEventModal from "./modules/BusMarketCouponsEventModal";
+import BusMarketCouponsEventDetailListModal from "./modules/BusMarketCouponsEventDetailListModal";
+import { filterObj } from "@/utils/util";
+import { getAction } from "@/api/manage";
+export default {
+  name: "marketRechargeList",
+  mixins: [JeecgListMixin],
+  components: {
+    BusMarketCouponsEventModal,
+    BusMarketCouponsEventDetailListModal,
+  },
+  data() {
+    return {
+      queryParam: {},
+      // 分页参数
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ["10", "20", "30"],
+        showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 共" + total + "条";
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+      // 表头
+      columns: [
+        {
+          title: "商家",
+          align: "center",
+          dataIndex: "hotelName",
+        },
+        {
+          title: "事件名称",
+          align: "center",
+          dataIndex: "name",
+        },
+        {
+          title: "事件类型",
+          align: "center",
+          dataIndex: "typeName",
+        },
+        {
+          title: "有效期",
+          align: "center",
+          dataIndex: "startTime",
+          scopedSlots: { customRender: "timeslot" },
+        },
+        {
+          title: "状态",
+          align: "center",
+          dataIndex: "remarks",
+          scopedSlots: { customRender: "stateslot" },
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 147,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
+      url: {
+        list: "/business/busMarketCouponsEvent/list",
+        delete: "/business/busMarketCouponsEvent/delete",
+        deleteBatch: "/business/busMarketCouponsEvent/deleteBatch",
+        exportXlsUrl: "/business/busMarketCouponsEvent/exportXls",
+        importExcelUrl: "/business/busMarketCouponsEvent/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+      selectedRowKeys: [],
+      isorter: {
+        column: "createTime",
+        order: "desc",
+      },
+      eventId: "",
+    };
+  },
+  created() {},
+  methods: {
+    handleConfig(item) {
+      this.eventId = item.id;
+      this.$refs.modalCouponsEventDetailList.eventId = item.id;
+      this.$refs.modalCouponsEventDetailList.visible = true;
+      this.$refs.modalCouponsEventDetailList.title = "赠送明细";
+      this.$refs.modalCouponsEventDetailList.add(item.id);
+    },
+  },
+};
+</script>
+  <style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 14 - 0
src/views/settings/components/BusMarketMemberLableList.vue

@@ -4,6 +4,7 @@
     <a-tag
       closable
       :visible="visible"
+      @click="handleEditGroup(item)"
       @close="tagClose(item)"
       v-for="(item, index) in groups"
       :key="index"
@@ -16,6 +17,7 @@
     <a-tag
       closable
       :visible="visible2"
+      @click="handleEditLabel(item)"
       @close="tagClose2(item)"
       v-for="(item, index) in labels"
       :key="index"
@@ -129,6 +131,18 @@ export default {
         },
       });
     },
+    handleEditGroup (item) {
+      console.log(1)
+      this.$refs.modalForm.edit(item);
+      this.$refs.modalForm.title = "编辑";
+      this.$refs.modalForm.disableSubmit = false;
+    },
+    handleEditLabel(item) {
+      console.log(1)
+      this.$refs.modalForm2.edit(item);
+      this.$refs.modalForm2.title = "编辑";
+      this.$refs.modalForm2.disableSubmit = false;
+    },
   },
 };
 </script>

+ 249 - 0
src/views/settings/components/modules/BusMarketCouponsEventDetailForm.vue

@@ -0,0 +1,249 @@
+<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="eventId">
+              <a-input v-model="model.eventId" placeholder="请输入关联事件"  ></a-input>
+            </a-form-model-item>
+          </a-col> -->
+
+          <a-col :span="24">
+            <a-form-model-item
+              label="类型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="type"
+            >
+              <a-radio-group v-model="model.type" @change="typeChange">
+                <a-radio :value="1">优惠券</a-radio>
+                <a-radio :value="3">免房券</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="会员等级"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="levelId"
+            >
+              <a-select
+                v-model="model.levelId"
+                placeholder="请选择"
+                style="width: 120px"
+                :allowClear="true"
+              >
+                <a-select-option
+                  :value="item.value"
+                  v-for="(item, index) in members"
+                  :key="index"
+                  >{{ item.label }}</a-select-option
+                >
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="选择券"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="couponsCashId"
+            >
+              <a-select
+                v-model="model.couponsCashId"
+                placeholder="请选择"
+                style="width: 120px"
+                :allowClear="true"
+              >
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in coupons"
+                  :key="index"
+                  >{{ item.name }}</a-select-option
+                >
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="数量"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="count"
+            >
+              <a-input-number
+                v-model="model.count"
+                :min="1"
+                :max="1000000"
+                :precision="0"
+                style="width: 20%"
+              />
+            </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";
+import {
+  getSelectList,
+  getBusMarketCouponsList,
+  getBusMarketCouponsCashList,
+} from "@/api/api";
+export default {
+  name: "BusMarketCouponsEventDetailForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { type: 1,eventId:'',couponsCashId:'' },
+      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: "请输入关联酒店!" }],
+        // eventId: [{ required: true, message: "请输入关联事件!" }],
+        type: [{ required: true, message: "请选择类型!" }],
+        levelId: [{ required: true, message: "请选择会员等级!" }],
+        couponsCashId: [{ required: true, message: "请选择券!" }],
+        count: [{ required: true, message: "请输入数量!" }],
+      },
+      url: {
+        add: "/business/busMarketCouponsEventDetail/add",
+        edit: "/business/busMarketCouponsEventDetail/edit",
+        queryById: "/business/busMarketCouponsEventDetail/queryById",
+      },
+      members: [],
+      coupons: [],
+    };
+  },
+  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));
+    getSelectList({ id: "" }).then((res) => {
+      if (res.success) {
+        this.members = res.result;
+      }
+    });
+  },
+  methods: {
+    typeChange(e) {
+      this.coupons = [];
+      this.model.couponsCashId=''
+      if (e.target.value == 1) {
+        getBusMarketCouponsList({ pageNo: 1, pageSize: 100 }).then((res) => {
+          if (res.success) {
+            this.coupons = res.result.records;
+          }
+        });
+      } else {
+        getBusMarketCouponsCashList({ pageNo: 1, pageSize: 100 }).then(
+          (res) => {
+            if (res.success) {
+              this.coupons = res.result.records;
+            }
+          }
+        );
+      }
+    },
+    add(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) {
+        getBusMarketCouponsList({ pageNo: 1, pageSize: 100 }).then((res) => {
+          if (res.success) {
+            this.coupons = res.result.records;
+          }
+        });
+      } else {
+        getBusMarketCouponsCashList({ pageNo: 1, pageSize: 100 }).then(
+          (res) => {
+            if (res.success) {
+              this.coupons = res.result.records;
+            }
+          }
+        );
+      }
+    },
+    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>

+ 206 - 0
src/views/settings/components/modules/BusMarketCouponsEventDetailList.vue

@@ -0,0 +1,206 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+    </div>
+
+    <!-- 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="typeSlot" slot-scope="text, record">
+          {{  record.type==1?'优惠券':'免房券'}}
+        </template>
+        <template slot="imgSlot" slot-scope="text, record">
+          <span v-if="!text" style="font-size: 12px; font-style: italic"
+            >无图片</span
+          >
+          <img
+            v-else
+            :src="getImgView(text)"
+            :preview="record.id"
+            height="25px"
+            alt=""
+            style="max-width: 80px; font-size: 12px; font-style: italic"
+          />
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px; font-style: italic"
+            >无文件</span
+          >
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)"
+          >
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm
+                  title="确定删除吗?"
+                  @confirm="() => handleDelete(record.id)"
+                >
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+      </a-table>
+    </div>
+
+    <bus-market-coupons-event-detail-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></bus-market-coupons-event-detail-modal>
+  </a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import { mixinDevice } from "@/utils/mixin";
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+import BusMarketCouponsEventDetailModal from "./BusMarketCouponsEventDetailModal";
+
+export default {
+  name: "BusMarketCouponsEventDetailList",
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    BusMarketCouponsEventDetailModal,
+  },
+  props: {
+    eventId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      description: "bus_market_coupons_event_detail_info管理页面",
+      // 表头
+      columns: [
+        {
+          title: "门店",
+          align: "center",
+          dataIndex: "hotelName",
+        },
+        {
+          title: "会员等级",
+          align: "center",
+          dataIndex: "levelName",
+        },
+        {
+          title: "券类型",
+          align: "center",
+          dataIndex: "type",
+          scopedSlots: { customRender: "typeSlot" },
+        },
+        {
+          title: "券名称",
+          align: "center",
+          dataIndex: "couponsName",
+        },
+        {
+          title: "数量",
+          align: "center",
+          dataIndex: "count",
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 147,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
+      url: {
+        list: "/business/busMarketCouponsEventDetail/list?eventId=" + this.eventId,
+        delete: "/business/busMarketCouponsEventDetail/delete",
+        deleteBatch: "/business/busMarketCouponsEventDetail/deleteBatch",
+        exportXlsUrl: "/business/busMarketCouponsEventDetail/exportXls",
+        importExcelUrl: "business/busMarketCouponsEventDetail/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+      // eventId: "",
+    };
+  },
+  created(e) {
+    // this.getSuperFieldList();
+
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
+    },
+  },
+  methods: {
+    add(eventId) {
+      // this.eventId = eventId;
+
+      // this.loadData();
+    },
+    handleAdd() {
+      console.log("eventId", this.eventId);
+      this.$refs.modalForm.add(this.eventId);
+      this.$refs.modalForm.title = "新增2";
+      this.$refs.modalForm.disableSubmit = false;
+    },
+    initDictConfig() {},
+    getSuperFieldList() {
+      let fieldList = [];
+      fieldList.push({ type: "string", value: "tenantId", text: "关联租户" });
+      fieldList.push({ type: "string", value: "hotelId", text: "关联酒店" });
+      fieldList.push({ type: "string", value: "eventId", text: "关联事件" });
+      fieldList.push({ type: "string", value: "levelId", text: "关联会员" });
+      fieldList.push({
+        type: "string",
+        value: "couponsCashId",
+        text: "关联卷",
+      });
+      fieldList.push({
+        type: "int",
+        value: "type",
+        text: "类型(1-优惠卷;3-免房卷)",
+      });
+      fieldList.push({ type: "int", value: "count", text: "赠送数量" });
+      this.superFieldList = fieldList;
+    },
+  },
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 69 - 0
src/views/settings/components/modules/BusMarketCouponsEventDetailListModal.vue

@@ -0,0 +1,69 @@
+<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="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-member-form> -->
+    <bus-market-coupons-event-detail-list :eventId="eventId" ref="modalCouponsEventDetailList"></bus-market-coupons-event-detail-list>
+  </j-modal>
+</template>
+
+<script>
+
+
+  import BusMarketCouponsEventDetailList from "./BusMarketCouponsEventDetailList";
+  export default {
+    name: 'BusMarketCouponsEventDetailListModal',
+    components: {
+      BusMarketCouponsEventDetailList
+    },
+    props: {
+      eventId: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false,
+        // eventId:'',
+      }
+    },
+    methods: {
+      add (eventId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.modalCouponsEventDetailList.add(this.eventId);
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.modalCouponsEventDetailList.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.modalCouponsEventDetailList.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 84 - 0
src/views/settings/components/modules/BusMarketCouponsEventDetailModal.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-event-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></bus-market-coupons-event-detail-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 BusMarketCouponsEventDetailForm from './BusMarketCouponsEventDetailForm'
+
+  export default {
+    name: 'BusMarketCouponsEventDetailModal',
+    components: {
+      BusMarketCouponsEventDetailForm
+    },
+    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/settings/components/modules/BusMarketCouponsEventDetailModal.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-event-detail-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-coupons-event-detail-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMarketCouponsEventDetailForm from './BusMarketCouponsEventDetailForm'
+  export default {
+    name: 'BusMarketCouponsEventDetailModal',
+    components: {
+      BusMarketCouponsEventDetailForm
+    },
+    data () {
+      return {
+        title:'',
+        width:1200,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add (eventId) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add(eventId);
+        })
+      },
+      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>

+ 207 - 0
src/views/settings/components/modules/BusMarketCouponsEventForm.vue

@@ -0,0 +1,207 @@
+<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="type"
+            >
+              <a-select
+                v-model="model.type"
+                placeholder="请选择"
+                style="width: 220px"
+                :allowClear="true"
+              >
+                <a-select-option
+                  :value="item.value"
+                  v-for="(item, index) in types"
+                  :key="index"
+                  >{{ item.label }}</a-select-option
+                >
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="状态"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="state"
+            >
+              <a-radio-group v-model="model.state">
+                <a-radio :value="0">禁用</a-radio>
+                <a-radio :value="1">启用</a-radio>
+              </a-radio-group>
+            </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: "BusMarketCouponsEventForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: {state:1},
+      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: "请输入关联酒店!" }],
+        name: [{ required: true, message: "请输入事件名称!" }],
+        startTime: [{ required: true, message: "请输入开始时间!" }],
+        endTime: [{ required: true, message: "请输入结束时间!" }],
+        type: [{ required: true, message: "请输入类型!" }],
+        state: [{ required: true, message: "请输入状态!" }],
+      },
+      url: {
+        add: "/business/busMarketCouponsEvent/add",
+        edit: "/business/busMarketCouponsEvent/edit",
+        queryById: "/business/busMarketCouponsEvent/queryById",
+      },
+      types: [
+        { value: 1, label: "会员注册" },
+        { value: 2, label: "会员生日" },
+        { value: 3, label: "会员升级" },
+        { value: 4, label: "会员充值" },
+        { value: 5, label: "已完成" },
+        { value: 6, label: "五星好评" },
+      ],
+    };
+  },
+  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: {
+    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>

+ 84 - 0
src/views/settings/components/modules/BusMarketCouponsEventModal.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-event-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></bus-market-coupons-event-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 BusMarketCouponsEventForm from './BusMarketCouponsEventForm'
+
+  export default {
+    name: 'BusMarketCouponsEventModal',
+    components: {
+      BusMarketCouponsEventForm
+    },
+    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/settings/components/modules/BusMarketCouponsEventModal.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-event-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-coupons-event-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusMarketCouponsEventForm from './BusMarketCouponsEventForm'
+  export default {
+    name: 'BusMarketCouponsEventModal',
+    components: {
+      BusMarketCouponsEventForm
+    },
+    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>

+ 4 - 1
src/views/settings/marketMemberList.vue

@@ -23,6 +23,7 @@
               <span slot="tab">
                   自动赠券
               </span>
+              <bus-market-coupons-event-list></bus-market-coupons-event-list>
           </a-tab-pane>
       </a-tabs>
   </a-card>
@@ -32,12 +33,14 @@
 import memberList from './components/memberList.vue';
 import marketRechargeList from './components/marketRechargeList.vue';
 import BusMarketMemberLableList from './components/BusMarketMemberLableList.vue';
+import BusMarketCouponsEventList from './components/BusMarketCouponsEventList.vue';
 
 export default {
   components:{
     memberList,
     marketRechargeList,
-    BusMarketMemberLableList
+    BusMarketMemberLableList,
+    BusMarketCouponsEventList
   },
   data() {
       return {