gqx 2 rokov pred
rodič
commit
54590bd015

+ 2 - 1
src/utils/excloudHotelIdParamPath/index.js

@@ -1,5 +1,6 @@
 import CesRoomLayoutPrice from './CesRoomLayoutPriceController'
-
+import MemeberController from './MemeberController'
 export default [
     ...CesRoomLayoutPrice.excloudUrls,
+    ...MemeberController.excloudUrls
 ]

+ 1 - 1
src/views/markets/marketInfo.vue

@@ -3,7 +3,7 @@
     <p>会员分组设置</p>
     <a-divider />
     <div class="space-align-container">
-      <div class="height-100" @click="toPage()">
+      <div class="height-100" @click="toPage('/tenant/marketinfo/member')">
         <img
           src="http://oss.qlan99.com/20200529/733024169836404bb2db66450167dd06.png"
         />

+ 710 - 0
src/views/markets/member.vue

@@ -0,0 +1,710 @@
+<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="3">
+            <a-form-item label="">
+              <a-select
+                mode="multiple"
+                style="width: 180px"
+                placeholder="商家名称"
+                :maxTagCount="1"
+                :maxTagTextLength="50"
+                v-model="queryParam.hotelIds"
+              >
+                <a-select-option
+                  v-for="(item, index) in hotelList"
+                  :key="index"
+                  :value="item.id"
+                >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-form-item label="">
+              <j-input
+                placeholder="会员名称"
+                v-model="queryParam.name"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-form-item label="">
+              <j-input
+                placeholder="会员手机号"
+                v-model="queryParam.mobile"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-form-item label="">
+              <j-input
+                placeholder="会员卡号"
+                v-model="queryParam.cardNo"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-form-item label="">
+              <a-select
+                v-model:value="queryParam.gradeId"
+                style="width: 100%"
+                placeholder="会员等级"
+                :allowClear="true"
+              >
+                <a-select-option
+                  v-for="(item, index) in gradeList"
+                  :key="index"
+                  :value="item.id"
+                  >{{ item.name }}</a-select-option
+                >
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-form-item label="">
+              <a-select
+                v-model:value="queryParam.groupId"
+                style="width: 100%"
+                placeholder="会员分组"
+                :allowClear="true"
+              >
+                <a-select-option
+                  v-for="(item, index) in groupList"
+                  :key="index"
+                  :value="item.id"
+                  >{{ item.name }}</a-select-option
+                >
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-form-item label="">
+              <a-select
+                v-model:value="queryParam.labelId"
+                style="width: 100%"
+                placeholder="会员标签"
+                :allowClear="true"
+              >
+                <a-select-option
+                  v-for="(item, index) in labelList"
+                  :key="index"
+                  :value="item.id"
+                  >{{ item.name }}</a-select-option
+                >
+              </a-select>
+            </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"
+      style="display: flex; justify-content: space-between"
+    >
+      <div>
+        <a-button @click="handleAdd" type="primary" icon="plus">办卡</a-button>
+        <a-button @click="handleAdd" type="danger" icon="minus"
+          >批量删除</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> -->
+      </div>
+      <div>
+        <a-switch @change="onSwitchChange" />
+      </div>
+      <!-- 高级查询区域 -->
+      <!-- <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>
+    <div v-show="showCard">
+      <a-row :gutter="24">
+        <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
+          <div class="ant-card ant-card-h">
+            <div class="ant-card-body" style="padding: 20px 24px 8px">
+              <div class="chart-card-header">
+                <div class="meta">
+                  <span class="chart-card-title">今日过生日的会员</span>
+                </div>
+                <div class="total" style="color: #ff5400">
+                  <span>{{ stat.birthdayCount||0 }}</span><span style="font-size: 15px">位</span>
+                </div>
+              </div>
+              <div class="chart-card-content">
+                <div class="content-fix">
+                  <div>
+                    <div style="margin-right: 16px">
+                      本月还有<span style="color: #ff5400">{{ stat.monthBirthdayCount||0 }}</span>位会员生日
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </a-col>
+
+        <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
+          <div class="ant-card ant-card-h">
+            <div class="ant-card-body" style="padding: 20px 24px 8px">
+              <div class="chart-card-header">
+                <div class="meta">
+                  <span class="chart-card-title">会员总数</span>
+                </div>
+                <div class="total" style="color: #ff5400">
+                  <span>{{ stat.count||0 }}</span><span style="font-size: 15px">位</span>
+                </div>
+              </div>
+              <div class="chart-card-content">
+                <div class="content-fix">
+                  <div>
+                    <div style="margin-right: 16px">
+                      今日新增<span style="color: #ff5400">{{ stat.dayCount||0 }}</span>位会员
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </a-col>
+
+        <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
+          <div class="ant-card ant-card-h">
+            <div class="ant-card-body" style="padding: 20px 24px 8px">
+              <div class="chart-card-header">
+                <div class="meta">
+                  <span class="chart-card-title">累计消费</span>
+                </div>
+                <div class="total" style="color: #ff5400">
+                  <span>0.00</span><span style="font-size: 15px">元</span>
+                </div>
+              </div>
+              <div class="chart-card-content">
+                <div class="content-fix">
+                  <div>
+                    <div style="margin-right: 16px">
+                      今日已有<span style="color: #ff5400">0</span
+                      >位会员消费<span style="color: #ff5400">0.00</span>元
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </a-col>
+
+        <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
+          <div class="ant-card ant-card-h">
+            <div class="ant-card-body" style="padding: 20px 24px 8px">
+              <div class="chart-card-header">
+                <div class="meta">
+                  <span class="chart-card-title">消费会员(TOP3)</span>
+                </div>
+              </div>
+              <div class="chart-card-content">
+                <div class="content-fix">
+                  <div>
+                    <div style="margin-right: 16px">暂无</div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </a-col>
+      </a-row>
+    </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="avatar" slot-scope="text">
+          <a-avatar v-if="text" :src="text" />
+          <a-avatar v-else icon="user" />
+        </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>
+      <a-select
+        style="width: 200px"
+        placeholder="请选择会员分组"
+        :disabled="selectedRowKeys.length <= 0"
+        v-model="groupId"
+        @change="groupChange"
+      >
+        <a-select-option
+          v-for="(item, index) in groupList"
+          :key="index"
+          :value="item.id"
+          >{{ item.name }}</a-select-option
+        >
+      </a-select>
+      <a-select
+        style="width: 200px; margin-left: 10px"
+        placeholder="请选择会员标签"
+        :disabled="selectedRowKeys.length <= 0"
+        v-model="labelId"
+        @change="labelChange"
+      >
+        <a-select-option
+          v-for="(item, index) in labelList"
+          :key="index"
+          :value="item.id"
+          >{{ item.name }}</a-select-option
+        >
+      </a-select>
+    </div>
+    <bus-member-card-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></bus-member-card-modal>
+  </a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import { mixinDevice } from "@/utils/mixin";
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+import { httpAction } from "@/api/manage";
+import BusMemberCardModal from "./modules/memberCard/BusMemberCardModal";
+
+export default {
+  name: "BusMemberCardList",
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    BusMemberCardModal,
+  },
+  data() {
+    const hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
+    return {
+      showCard: false,
+      groupId: undefined,
+      labelId: undefined,
+      description: "会员页面",
+      datetime: [],
+      // 表头
+      columns: [
+        {
+          title: "商家",
+          align: "center",
+          dataIndex: "hotelName",
+        },
+        {
+          title: "头像",
+          align: "center",
+          dataIndex: "avatar",
+          scopedSlots: { customRender: "avatar" },
+        },
+        {
+          title: "会员姓名",
+          align: "center",
+          dataIndex: "name",
+        },
+        {
+          title: "手机号",
+          align: "center",
+          dataIndex: "mobile",
+        },
+        {
+          title: "性别",
+          align: "center",
+          dataIndex: "sex",
+          customRender: function (text) {
+            return text === 1 ? "男" : "女";
+          },
+        },
+        {
+          title: "会员卡号",
+          align: "center",
+          dataIndex: "cardNo",
+        },
+        {
+          title: "等级类型",
+          align: "center",
+          dataIndex: "gradeName",
+        },
+        {
+          title: "证件号",
+          align: "center",
+          dataIndex: "certificateNo",
+        },
+        {
+          title: "创建日期",
+          align: "center",
+          dataIndex: "createTime",
+        },
+        {
+          title: "推荐员工",
+          align: "center",
+          dataIndex: "staffId",
+        },
+        {
+          title: "可用积分",
+          align: "center",
+          dataIndex: "integral",
+        },
+        {
+          title: "可用余额",
+          align: "center",
+          dataIndex: "balance",
+        },
+        {
+          title: "标签",
+          align: "center",
+          dataIndex: "labelName",
+        },
+        {
+          title: "分组",
+          align: "center",
+          dataIndex: "groupName",
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 147,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
+      url: {
+        list:
+          hotelInfo && hotelInfo.id
+            ? "/business/busMemberCard/list?hotelId=" + hotelInfo.id
+            : "/business/busMemberCard/list",
+        delete: "/business/busMemberCard/delete",
+        deleteBatch: "/business/busMemberCard/deleteBatch",
+        exportXlsUrl: "/business/busMemberCard/exportXls",
+        importExcelUrl: "business/busMemberCard/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+      hotelList: [],
+      gradeList: [],
+      groupList: [],
+      labelList: [],
+    };
+  },
+  created() {
+    // this.getSuperFieldList();
+    httpAction(
+      "/business/busHotel/list",
+      { pageNo: 1, pageSize: 100 },
+      "get"
+    ).then((res) => {
+      if (res.success) {
+        this.hotelList = res.result.records;
+      }
+    });
+    httpAction(
+      "/org.jeecg.modules.business/busMarketMember/list",
+      { pageNo: 1, pageSize: 100 },
+      "get"
+    ).then((res) => {
+      if (res.success) {
+        this.gradeList = res.result.records;
+      }
+    });
+    httpAction(
+      "/business/busMarketMemberGroup/list",
+      { pageNo: 1, pageSize: 100 },
+      "get"
+    ).then((res) => {
+      if (res.success) {
+        this.groupList = res.result.records;
+      }
+    });
+    httpAction(
+      "/business/busMarketMemberLable/list",
+      { pageNo: 1, pageSize: 100 },
+      "get"
+    ).then((res) => {
+      if (res.success) {
+        this.labelList = res.result.records;
+      }
+    });
+    httpAction(
+      "/business/busMemberCard/stat",
+      {},
+      "get"
+    ).then((res) => {
+      if (res.success) {
+        this.stat = res.result;
+      }
+    });
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
+    },
+  },
+  methods: {
+    groupChange(e) {
+      if (this.selectedRowKeys.length <= 0) {
+        this.$message.warning("请选择一条记录!");
+        return;
+      }
+      var that = this;
+      httpAction(
+        "/business/busMemberCard/groupBatch",
+        {
+          groupId: e,
+          ids: this.selectedRowKeys,
+        },
+        "post"
+      )
+        .then((res) => {
+          if (res.success) {
+            that.$message.success(res.message);
+            that.groupId = undefined;
+            that.modalFormOk();
+          } else {
+            that.$message.warning(res.message);
+          }
+        })
+        .finally(() => {});
+    },
+    labelChange(e) {
+      if (this.selectedRowKeys.length <= 0) {
+        this.$message.warning("请选择一条记录!");
+        return;
+      }
+      var that = this;
+      httpAction(
+        "/business/busMemberCard/lableBatch",
+        {
+          labelId: e,
+          ids: this.selectedRowKeys,
+        },
+        "post"
+      )
+        .then((res) => {
+          if (res.success) {
+            that.$message.success(res.message);
+            that.labelId = undefined;
+            that.modalFormOk();
+          } else {
+            that.$message.warning(res.message);
+          }
+        })
+        .finally(() => {});
+    },
+    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];
+    },
+    onSwitchChange(e) {
+      console.log(e);
+      this.showCard = e;
+    },
+    initDictConfig() {},
+    getSuperFieldList() {
+      let fieldList = [];
+      fieldList.push({ type: "string", value: "tenantId", text: "关联租户" });
+      fieldList.push({ type: "string", value: "hotelId", text: "关联酒店" });
+      fieldList.push({ type: "string", value: "mobile", text: "手机号" });
+      fieldList.push({ type: "string", value: "cardNo", text: "会员卡号" });
+      fieldList.push({ type: "string", value: "cardInnerNo", text: "卡内码" });
+      fieldList.push({ type: "string", value: "gradeId", text: "等级类型" });
+      fieldList.push({ type: "number", value: "memberFee", text: "会员费" });
+      fieldList.push({ type: "int", value: "payType", text: "付款类型" });
+      fieldList.push({ type: "int", value: "paymentMethod", text: "付款方式" });
+      fieldList.push({ type: "string", value: "name", text: "会员姓名" });
+      fieldList.push({ type: "string", value: "avatar", text: "头像" });
+      fieldList.push({ type: "int", value: "sex", text: "性别" });
+      fieldList.push({
+        type: "int",
+        value: "certificateType",
+        text: "证件类型",
+      });
+      fieldList.push({
+        type: "string",
+        value: "certificateNo",
+        text: "证件号",
+      });
+      fieldList.push({ type: "string", value: "address", text: "地址" });
+      fieldList.push({
+        type: "string",
+        value: "consumePassword",
+        text: "消费密码",
+      });
+      fieldList.push({ type: "int", value: "validity", text: "有效期" });
+      fieldList.push({
+        type: "date",
+        value: "validityEndTime",
+        text: "有效期截止日期",
+      });
+      fieldList.push({ type: "string", value: "remark", text: "备注" });
+      fieldList.push({ type: "string", value: "staffId", text: "推荐员工" });
+      fieldList.push({ type: "int", value: "integral", text: "可用积分" });
+      fieldList.push({ type: "number", value: "balance", text: "可用余额" });
+      this.superFieldList = fieldList;
+    },
+  },
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+/deep/ .ant-input-search-button {
+  background-color: #ff4d4f;
+  border-color: #ff4d4f;
+}
+/deep/ .ant-input-search-button[disabled]:hover {
+  opacity: 0.7;
+  background-color: #ff4d4f;
+  border-color: #ff4d4f;
+}
+/deep/ .ant-input-search-button[disabled] {
+  opacity: 0.7;
+  color: #ffffff;
+}
+.ant-card-h {
+  border: 1px solid #e8e8e8;
+  height: 150px;
+}
+.total {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  word-break: break-all;
+  white-space: nowrap;
+  color: #000;
+  margin-top: 4px;
+  margin-bottom: 0;
+  font-size: 30px;
+  line-height: 38px;
+  height: 38px;
+}
+.chart-card-content {
+  margin-bottom: 12px;
+  position: relative;
+  height: 46px;
+  width: 100%;
+}
+.chart-card-content .content-fix {
+  position: absolute;
+  left: 0;
+  bottom: 0;
+  width: 100%;
+}
+</style>
+

+ 6 - 1
src/views/markets/modules/Provide/BusMemberCardList.vue

@@ -154,7 +154,9 @@ export default {
     },
   },
   data() {
+    const hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
     return {
+      hotelId: "",
       num: 1,
       description: "bus_member_card管理页面",
       // 表头
@@ -228,7 +230,10 @@ export default {
         // }
       ],
       url: {
-        list: "/business/busMemberCard/list",
+        list:
+          hotelInfo && hotelInfo.id
+            ? "/business/busMemberCard/list?hotelId=" + hotelInfo.id
+            : "/business/busMemberCard/list",
         delete: "/business/busMemberCard/delete",
         deleteBatch: "/business/busMemberCard/deleteBatch",
         exportXlsUrl: "/business/busMemberCard/exportXls",

+ 5 - 2
src/views/markets/modules/couponsCash/BusMarketCouponsCashUsedList.vue

@@ -127,7 +127,9 @@
         </template>
 
         <span slot="action" slot-scope="text, record">
-          <a v-if="record.statusName!=='已作废'" @click="handleEdit(record)">作废</a>
+          <a v-if="record.statusName !== '已作废'" @click="handleEdit(record)"
+            >作废</a
+          >
         </span>
       </a-table>
     </div>
@@ -230,7 +232,8 @@ export default {
         },
       ],
       url: {
-        list: "/business/busMarketCouponsCashUsed/list?couponsId=" + this.couponsId,
+        list:
+          "/business/busMarketCouponsCashUsed/list?couponsId=" + this.couponsId,
         delete: "/business/busMarketCouponsCashUsed/delete",
         deleteBatch: "/business/busMarketCouponsCashUsed/deleteBatch",
         exportXlsUrl: "/business/busMarketCouponsCashUsed/exportXls",

+ 286 - 0
src/views/markets/modules/memberCard/BusMemberCardForm.vue

@@ -0,0 +1,286 @@
+<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="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="cardNo">
+              <a-input v-model="model.cardNo" placeholder="请输入会员卡号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="卡内码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cardInnerNo">
+              <a-input v-model="model.cardInnerNo" placeholder="请输入卡内码"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="等级类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gradeId">
+              <a-select
+                v-model:value="model.gradeId"
+                style="width: 100%"
+                placeholder="会员等级"
+                :allowClear="true"
+              >
+                <a-select-option
+                  v-for="(item, index) in gradeList"
+                  :key="index"
+                  :value="item.id"
+                  >{{ 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="memberFee">
+              <a-input-number v-model="model.memberFee" placeholder="请输入会员费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="付款类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="payType">
+              <a-radio-group v-model="model.payType">
+                <a-radio :value="1">现付</a-radio>
+                <a-radio :value="2" disabled>转房帐</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24" v-if="model.payType==1">
+            <a-form-model-item label="付款方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="paymentMethod">
+              <a-select
+                v-model="model.paymentMethod"
+                style="width: 100%"
+                placeholder="付款方式"
+                :allowClear="true"
+              >
+                <a-select-option
+                  v-for="(item, index) in paymentMethodList"
+                  :key="index"
+                  :value="item.id"
+                  >{{ 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="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="avatar">
+              <a-input v-model="model.avatar" placeholder="请输入头像"  ></a-input>
+            </a-form-model-item>
+          </a-col> -->
+          <a-col :span="24">
+            <a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sex">
+              <a-radio-group v-model="model.sex">
+                <a-radio :value="1">男</a-radio>
+                <a-radio :value="2">女</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="certificateType">
+              <a-select
+                v-model="model.certificateType"
+                style="width: 100%"
+                placeholder="证件类型"
+                :allowClear="true"
+              >
+                <a-select-option :value="1" >身份证</a-select-option>
+              </a-select>
+            </a-form-model-item>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="证件号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="certificateNo">
+              <a-input v-model="model.certificateNo" placeholder="请输入证件号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
+              <a-input v-model="model.address" placeholder="请输入地址"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="消费密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="consumePassword">
+              <a-input-password  v-model="model.consumePassword" placeholder="请输入消费密码"></a-input-password>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="有效期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="validity">
+              <a-radio-group v-model="model.validity">
+                <a-radio :value="1">无限制</a-radio>
+                <a-radio :value="2">有限制</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24" v-if="model.validity==2">
+            <a-form-model-item label="有效期截止日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="validityEndTime" :rules="[
+                                        {
+                                            required: true,
+                                            message: '请输入有效期截止日期',
+                                            trigger: 'change',
+                                        },
+                                    ]">
+              <j-date placeholder="请选择有效期截止日期" v-model="model.validityEndTime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
+              <a-textarea v-model="model.remark" rows="4" placeholder="请输入备注" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="推荐员工" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="staffId">
+              <a-select
+                v-model="model.staffId"
+                style="width: 100%"
+                placeholder="推荐员工"
+                :allowClear="true"
+              >
+                <a-select-option
+                  v-for="(item, index) in staffList"
+                  :key="index"
+                  :value="item.id"
+                  >{{ item.name }}</a-select-option
+                >
+              </a-select>
+            </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: "BusMemberCardForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: { payType: 1 },
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        mobile: [
+          {
+            required: true,
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入手机号!",
+          },
+        ],
+        cardNo: [{ required: true, message: "请输入会员卡号!" }],
+        gradeId: [{ required: true, message: "请输入等级类型!" }],
+        payType: [{ required: true, message: "请输入付款类型!" }],
+        paymentMethod: [{ required: true, message: "请输入付款方式!" }],
+        name: [{ required: true, message: "请输入会员姓名!" }],
+        sex: [{ required: true, message: "请输入性别!" }],
+        certificateType: [{ required: true, message: "请输入证件类型!" }],
+        validity: [{ required: true, message: "请输入有效期!" }],
+      },
+      url: {
+        add: "/business/busMemberCard/add",
+        edit: "/business/busMemberCard/edit",
+        queryById: "/business/busMemberCard/queryById",
+      },
+      gradeList: [],
+      paymentMethodList: [],
+      staffList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    httpAction(
+      "/org.jeecg.modules.business/busMarketMember/list",
+      { pageNo: 1, pageSize: 100 },
+      "get"
+    ).then((res) => {
+      if (res.success) {
+        this.gradeList = res.result.records;
+      }
+    });
+    httpAction(
+      "/business/busRoomPayType/queryList",
+      { pageNo: 1, pageSize: 100 },
+      "get"
+    ).then((res) => {
+      if (res.success) {
+        this.paymentMethodList = res.result;
+      }
+    });
+    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/markets/modules/memberCard/BusMemberCardModal.Style#Drawer.vue

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