MONSTER-ygh 1 рік тому
батько
коміт
4d0d1e2dce

+ 25 - 55
src/views/tourism/membershipManagement/physicalCard/detailsBox/memberInformationDetails.vue

@@ -2,7 +2,7 @@
   <el-dialog
     :title="title"
     :visible.sync="open"
-    width="70%"
+    width="50%"
     append-to-body
     :close-on-click-modal="false"
     @close="cancel"
@@ -18,57 +18,29 @@
         element-loading-spinner="''"
         element-loading-background="rgba(0, 0, 0, 0.8)"
         >
-        <el-form :model="form" ref="form" :rules="rules" label-width="120px">
+        <el-form :model="form" ref="form" :rules="rules" label-width="200px">
           <div class="form-title"><span>基本信息</span></div>
-          <div style="display: flex;">
-            <el-form-item label="会员名称:">
-              <span style="display: block; min-width: 250px;">{{ form.realName }}</span>
-            </el-form-item>
-            <el-form-item label="性别:">
-              <dict-tag :options="dict.type.tourism_memberInformation_sex" :value="form.sex"/>
-            </el-form-item>
-          </div>
-          <div style="display: flex;">
-            <el-form-item label="手机号:">
-              <span style="display: block;min-width: 250px;">{{ form.mobile }}</span>
-            </el-form-item>
-            <el-form-item label="身份证号:">
-              <span style="display: block;min-width: 250px;">{{ form.cardId }}</span>
-            </el-form-item>
-          </div>
-          <div style="display: flex;">
-            <el-form-item label="注册时间:">
-              <span style="display: block;min-width: 250px;">{{ form.createTime }}</span>
-            </el-form-item>
-          </div>
-          <div class="form-title"><span>会员信息</span></div>
-          <div style="display: flex;">
-            <el-form-item label="会员类型:">
-              <span style="display: block;min-width: 250px;">
-                <dict-tag :options="dict.type.tourism_memberInformation_user_type" :value="form.type"/>
-              </span>
-            </el-form-item>
-            <el-form-item label="会员卡号:">
-              <span style="display: block;min-width: 250px;">{{ form.name }}</span>
-            </el-form-item>
-          </div>
-          <div style="display: flex;">
-            <el-form-item label="剩余积分:">
-              <span style="display: block;min-width: 250px;">{{ form.credit }}</span>
-            </el-form-item>
-            <el-form-item label="剩余储值:">
-              <span style="display: block;min-width: 250px;">{{ form.balance }}</span>
-            </el-form-item>
-          </div>
-          <div class="form-title"><span>消费数据</span></div>
-          <div style="display: flex;">
-            <el-form-item label="下单数(单):">
-              <span style="display: block;min-width: 250px;">{{ form.orderCount }}</span>
-            </el-form-item>
-            <el-form-item label="支付成功数(单):">
-              <span style="display: block;min-width: 250px;">{{ form.buyCount }}</span>
-            </el-form-item>
-          </div>
+          <el-form-item label="实体卡号:" prop="cardNo">
+            <span>{{ form.cardNo }}</span>
+          </el-form-item>
+          <el-form-item label="办卡类型:" prop="cardName">
+            <span>{{ form.cardName }}</span>
+          </el-form-item>
+          <el-form-item label="持卡人:" prop="userName">
+            <span>{{ form.userName }}</span>
+          </el-form-item>
+          <el-form-item label="身份证号:" prop="idCard">
+            <span>{{ form.idCard }}</span>
+          </el-form-item>
+          <el-form-item label="手机号:" prop="phone">
+            <span>{{ form.phone }}</span>
+          </el-form-item>
+          <el-form-item label="可退金额:" prop="refundAmount">
+            <span>{{ form.refundAmount }}</span>
+          </el-form-item>
+          <el-form-item label="余额:" prop="amount">
+            <span>{{ form.amount }}</span>
+          </el-form-item>
         </el-form>
       </div>
     </div>
@@ -97,7 +69,7 @@ export default {
       formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2  : 获取详情失败 
       configUrl: {
         add: '', // 新增地址
-        details: '/member/memberInfo/detail', // 详情地址
+        details: '/merchant/merchantEntitycard/selectById', // 详情地址
         edit: '', // 编辑地址
       },
       form: {
@@ -117,12 +89,11 @@ export default {
       this.model = model
       this.formStatus = 0
       if(model=='ADD') { // 新增
-        this.$set(this,'form',{...row,imgUrl:[]})
+        this.$set(this,'form',{...row})
         this.formStatus = 1
       }else if(model=='EDIT') { // 新增
         let obj = {
           ...row,
-          imgUrl: row.imgUrl?row.imgUrl.split(','):[]
         }
         this.$set(this,'form',obj)
         this.formStatus = 1
@@ -145,7 +116,6 @@ export default {
         if(res.code == 200) {
           let obj = {
             ...res.data,
-            imgUrl: res.data.imgUrl?res.data.imgUrl.split(','):[],
         }
           this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
           this.formStatus = 1

+ 0 - 491
src/views/tourism/membershipManagement/physicalCard/formBox/membershipLevelForm.vue

@@ -1,491 +0,0 @@
-<template>
-  <el-dialog
-    :title="title"
-    :visible.sync="open"
-    width="75%"
-    append-to-body
-    :close-on-click-modal="false"
-    @close="cancel"
-  >
-    <div class="form-dialog-box"
-    v-loading="loading"
-    :element-loading-text="loadingText"
-    element-loading-spinner="el-icon-loading"
-    element-loading-background="rgba(0, 0, 0, 0)">
-      <div
-        v-loading="loading"
-        :element-loading-text="''"
-        element-loading-spinner="''"
-        element-loading-background="rgba(0, 0, 0, 0.8)"
-        >
-        <el-form :model="form" ref="form" :rules="rules" label-width="200px">
-          <div class="form-title"><span>基本信息</span></div>
-          <el-form-item label="等级名称:" prop="name">
-            <el-input style="width: 350px;" v-model="form.name" placeholder="请输入等级名称" maxlength="50" show-word-limit />
-          </el-form-item>
-          <el-form-item label="所需积分值:" prop="upIntegral">
-            <el-input-number style="width: 350px;" v-model="form.upIntegral" controls-position="right" placeholder="请输入所需积分值"></el-input-number>
-          </el-form-item>
-          <el-form-item label="等级图片" prop="logo">
-            <div style="display: flex;">
-              <div 
-              v-for="(item,index) in form.logo" 
-              :key="index"
-              style="width: 100px; height: 100px;position: relative;border: 1px solid #999;border-radius: 5px;margin-right: 20px;">
-                <el-image 
-                  style="width: 100%; height: 100%"
-                  :src="item" 
-                  :preview-src-list="form.logo">
-                </el-image>
-                <span @click="handleRemove(index)" style="position: absolute;top: -15px;right: -15px;color: red;font-size: 24px;z-index: 999;cursor: pointer;">
-                  <i class="el-icon-error"></i>
-                </span>
-              </div>
-              <div 
-              style="width: 100px; height: 100px;" 
-              v-if="!form.logo||form.logo.length<1"
-              v-loading="actionUrlLoading"
-              element-loading-text="上传中..."
-              element-loading-spinner="el-icon-loading"
-              element-loading-background="rgba(0, 0, 0, 0.8)"
-              >
-                <el-upload
-                  class="avatar-uploader"
-                  :action="actionUrl"
-                  :data="{
-                    bucket: 'tourism'
-                  }"
-                  :show-file-list="false"
-                  :before-upload="beforeAvatarUpload"
-                  :on-success="handleAvatarSuccess"
-                  :on-progress="handleAvatarProgress"
-                  :disabled="actionUrlLoading"
-                  :on-error="handleAvatarError"
-                  >
-                  <i class="el-icon-plus avatar-uploader-icon"></i>
-                </el-upload>
-              </div>
-              
-            </div>
-            <span>建议尺寸XXX*XXX,支持jpg、png,支持100KB大小以内的图片上传</span>
-          </el-form-item>
-          <div class="form-title"><span>会员权益</span></div>
-          <el-form-item label="折扣权益:">
-            <div style="display: flex;align-items: center;">
-              <el-form-item label="基本折扣:" prop="discount" label-width="100px">
-                <el-input-number style="width: 150px;" v-model="form.discount" controls-position="right" placeholder="请输入基本折扣"></el-input-number>
-                <span style="padding-bottom: 15px;">%</span>
-              </el-form-item>
-              <el-button style="margin-left: 15px;" v-if="!form.classifyList||form.classifyList.length==0" type="primary" @click="addClassifyList">添加单品</el-button>
-            </div>
-            
-            <div v-for="(item,index) in form.classifyList" :key="index" style="margin-top: 10px;display: flex;align-items: center;">
-              <el-form-item label="单品折扣:" label-width="100px">
-                <el-select v-model="form.classifyList[index].classifyId" clearable placeholder="请选择单品">
-                  <el-option
-                    v-for="item in scenicAreaProducts"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                  </el-option>
-                </el-select>
-                <el-input-number style="width: 150px;margin-left: 20px;" v-model="form.classifyList[index].discount" placeholder="请输入单品折扣" controls-position="right"></el-input-number>
-                <span style="padding-bottom: 15px;">%</span>
-              </el-form-item>
-              <el-button style="margin-left: 15px;" v-if="form.classifyList.length==(index+1)" type="primary" @click="addClassifyList">添加单品</el-button>
-              <el-button style="margin-left: 15px;" type="danger" @click="clearClassifyList(index)">移除</el-button>
-            </div>
-          </el-form-item>
-          <el-form-item label="积分权益:">
-            <el-form-item label="积分成长系数:" prop="integralRatio" label-width="120px">
-              <el-input-number style="width: 150px;" v-model="form.integralRatio" placeholder="请输入积分成长系数" controls-position="right"></el-input-number>
-              <span style="padding-bottom: 15px;font-size: 12px;color: #ccc;">(会员下单获取积分值=实付金额**积分规则基础系数"会员成长系数会员系数越大,获得成长值越多,建议数值设置不要过大)</span>
-            </el-form-item>
-          </el-form-item>
-          <el-form-item label="专属优惠卷:" prop="couponIdList">
-            <el-select v-model="form.couponIdLList" clearable placeholder="请选择专属优惠卷">
-              <el-option
-                v-for="item in scenicAreaProducts"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-                </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="指定产品不参与会员折扣:" prop="goodsIdList">
-            <el-select v-model="form.goodsIdList" clearable placeholder="请选择指定产品不参与会员折扣">
-              <el-option
-                v-for="item in scenicAreaProducts"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-                </el-option>
-            </el-select>
-          </el-form-item>
-        </el-form>
-      </div>
-    </div>
-    <span slot="footer" class="dialog-footer" v-if="formStatus==1">
-      <el-button @click="cancel">取消</el-button>
-      <el-button
-        type="primary"
-        @click="submitForm"
-        :loading="loading"
-        element-loading-text="提交中..."
-        element-loading-spinner="el-icon-loading"
-        element-loading-background="rgba(0, 0, 0, 0.8)"
-      > 
-        {{ loading ? '提交中...' : '保存' }}
-      </el-button>
-    </span>
-    <!-- 添加或修改对话框 End -->
-  </el-dialog>
-</template>
-
-<script>
-import { 
-  getTableDeatilsByIdApi,
-  updateTableApi,
-  addTableApi
- } from '@/api/CURD'
-
-export default {
-  name: "addAndEdit",
-  dicts: [],
-  data() {
-    return {
-      title: "",
-      model: "", // EDIT: 编辑模式 ADD : 新增模式  EDITInit : 编辑模式(需要请求详情)
-      open: false,
-      loading: false,
-      loadingText: "拼命加载数据中...",
-      formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2  : 获取详情失败 
-      configUrl: {
-        add: '/member/memberLevelInfo/insertOrUpdate', // 新增地址
-        details: '/member/memberLevelInfo/selectById', // 详情地址
-        edit: '/member/memberLevelInfo/insertOrUpdate', // 编辑地址
-      },
-      form: {
-        id: undefined,
-      },
-      rules: {
-        name: [{ required: true, message: "请输入等级名称", trigger: ["change","blur"] }],
-        logo: [{ required: true, message: "请上传图片", trigger: ["change","blur"] }],
-        upIntegral: [{ required: true, message: "请输入所需积分值", trigger: ["change","blur"] }],
-        discount: [{ required: true, message: "请输入基本折扣", trigger: ["change","blur"] }],
-        integralRatio: [{ required: true, message: "请输入积分成长系数", trigger: ["change","blur"] }],
-      },
-      scenicAreaProducts: [],// 景点产品关联
-
-      //  上传文件
-      actionUrl: process.env.VUE_APP_BASE_API + process.env.VUE_APP_UPLOAD_IMAGE,
-      actionUrlLoading: false,
-    };
-  },
-  methods: {
-    async initData(title , model,row){
-      this.title = title
-      this.open = true
-      this.loadingText = "拼命加载数据中..."
-      this.loading = true
-      this.actionUrlLoading = false
-      this.model = model
-      this.formStatus = 0
-      if(model=='ADD') { // 新增
-        this.$set(this,'form',{...row,logo:[]})
-        this.formStatus = 1
-      }else if(model=='EDIT') { // 新增
-        let obj = {
-          ...row,
-          logo: row.logo?row.logo.split(','):[]
-        }
-        this.$set(this,'form',obj)
-        this.formStatus = 1
-      }else if(model=='EDITInit') { // 新增
-        await this.getTableDeatilsFun(row)
-      }
-      this.loading = false
-      this.$nextTick(()=>{
-        if(this.$refs["form"]) {
-          this.$refs["form"].clearValidate();
-        }
-      })
-    },
-    /** 获取详情 */
-    async getTableDeatilsFun(row) {
-      const id = row.id
-      this.loading = true
-      try {
-        let res = await getTableDeatilsByIdApi(this.configUrl.details,{id})
-        if(res.code == 200) {
-          let obj = {
-            ...res.data,
-            logo: res.data.logo?res.data.logo.split(','):[],
-        }
-          this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
-          this.formStatus = 1
-        }else {
-          this.$message.error('获取详情失败!!!');
-          this.formStatus = 2
-          this.loading = false
-          this.open = false;
-        }
-        this.loading = false
-      } catch (error) {
-        console.error('获取详情失败!!!!',error)
-        this.formStatus = 2
-        this.loading = false
-        this.open = false;
-      }
-    },
-    /**
-     * 保存
-     * @date 2023-11-22
-     * @returns {any}
-     */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          this.loadingText = "提交数据中..."
-          this.loading = true
-          if (this.model != 'ADD') {
-            addTableApi(
-              this.configUrl.edit,{
-                ...this.form,
-                logo: this.form.logo ? this.form.logo.join(','):''
-              }).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.loading = false
-              this.open = false;
-              this.$emit('refresh')
-            }).catch(()=>{
-              this.$message.error("修改失败!!!");
-              this.loading = false
-            })
-          } else {
-            addTableApi(this.configUrl.edit,{
-                ...this.form,
-                logo: this.form.logo ? this.form.logo.join(','):''
-              }).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.loading = false
-              this.open = false;
-              this.$emit('refresh')
-            }).catch(()=>{
-              this.$message.error("新增失败!!!");
-              this.loading = false
-            })
-          }
-        }
-      });
-    },
-    /**
-     * 重置
-     * @date 2023-11-22
-     * @returns {any}
-     */
-    reset() {
-      if(this.$refs["form"]) {
-        this.$refs["form"].clearValidate();
-      }
-    },
-    /**
-     * 关闭弹框
-     * @date 2023-11-22
-     * @returns {any}
-     */
-    cancel() {
-      this.reset();
-      this.open = false;
-    },
-
-    /**  上传图片 单张  */
-    handleAvatarSuccess(response, file, fileList) {
-      console.log("res, file",response, file, fileList)
-      this.actionUrlLoading = false
-      if(response.code == 200) {
-        this.form.logo.push(response.data.url)
-      }
-    },
-    beforeAvatarUpload(file) {
-      const isLt2M = file.size / 1024 / 1024 < 1;
-      let testmsg = file.name.substring(file.name.lastIndexOf('.')+1)
-      let typeList = ['png','jepg','jpg']
-      const isJPG = typeList.includes(testmsg);
-      if (!isJPG) {
-        this.$message.error(`上传头像图片只能是 ${typeList} 格式!`);
-      }
-      if (!isLt2M) {
-        this.$message.error('上传头像图片大小不能超过 1MB!');
-      }
-      return isJPG && isLt2M;
-    },
-    handleAvatarProgress(){
-      this.actionUrlLoading = true
-    },
-    handleAvatarError() {
-      this.actionUrlLoading = false
-    },
-    handleRemove(index) {
-      this.form.logo.splice(index,1)
-    },
-
-    /** 填加单品  */
-    addClassifyList(){
-      let list = []
-      if(this.form.classifyList) {
-        list = JSON.parse(JSON.stringify(this.form.classifyList))
-      }
-      list.push({
-        classifyId: null,
-        discount: null,
-        classifyName: null
-      })
-      this.$set(this.form,'classifyList',list)
-    }, 
-    /** 移除单品  */
-    clearClassifyList(index) {
-      this.form.classifyList.splice(index,1)
-    }
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.form-dialog-box {
-  padding: 0 30px;
-  padding: 0 30px;
-  min-height: 50vh;
-  max-height: 65vh;
-  overflow-y: auto;
-  >div {
-    width: 100%;
-    min-height: 50vh;
-  }
-  .form-title {
-    padding: 0 0 10px 0;
-    span {
-      display: flex;
-      color: rgba(65,80,88,1);
-      font-size: 16px;
-      font-family: SourceHanSansSC;
-      font-weight: 700;
-      line-height: 23px;
-      border-left: 4px solid rgb(22, 132, 252);
-      padding-left: 10px;
-    }
-    
-  }
-  ::v-deep .ql-editor {
-    height: 400px;
-  }
-  .upload-btn {
-    width: 100px;
-    height: 100px;
-    background-color: #fbfdff;
-    border: dashed 1px #c0ccda;
-    border-radius: 5px;
-    i {
-      font-size: 30px;
-      margin-top: 20px;
-    }
-    &-text {
-      margin-top: -10px;
-    }
-  }
-  .avatar {
-    cursor: pointer;
-  }
-}
-.el-table{
-  .upload-btn {
-    width: 100px;
-    height: 100px;
-    background-color: #fbfdff;
-    border: dashed 1px #c0ccda;
-    border-radius: 5px;
-    i {
-      font-size: 30px;
-      margin-top: 20px;
-    }
-    &-text {
-      margin-top: -10px;
-    }
-  }
-  .avatar {
-    cursor: pointer;
-  }
-}
-
-.area-container {
-  min-height: 400px;
-}
-
-::v-deep .area-wrap-city.el-cascader {
-  line-height: normal;
-  .el-input {
-    cursor: pointer;
-    width: 100% !important;
-    height: 28px !important;
-    .el-input__inner {
-      display: none !important;
-    }
-    span.el-input__suffix {
-      position: inherit !important;
-      i.el-input__icon {
-        line-height: inherit;
-        margin-left: 5px;
-      }
-    }
-
-    .el-input__wrapper {
-      box-shadow: none;
-      input {
-        display: none;
-      }
-    }
-  }
-
-  .el-cascader__tags {
-    display: none;
-  }
-}
-
-.area-city-popper {
-  .el-cascader-panel {
-    .el-scrollbar.el-cascader-menu {
-      .el-cascader-menu__wrap.el-scrollbar__wrap {
-        height: 315px;
-      }
-    }
-  }
-}
-::v-deep .avatar-uploader .el-upload {
-    border: 1px dashed #d9d9d9;
-    border-radius: 6px;
-    cursor: pointer;
-    position: relative;
-    overflow: hidden;
-  }
-  ::v-deep .avatar-uploader .el-upload:hover {
-    border-color: #409EFF;
-  }
-  ::v-deep .avatar-uploader-icon {
-    font-size: 28px;
-    color: #8c939d;
-    width: 100px;
-    height: 100px;
-    line-height: 100px;
-    text-align: center;
-  }
-  ::v-deep .avatar {
-    width: 100px;
-    height: 100px;
-    display: block;
-  }
-</style>
-<style>
-.custom-class-box {
-  z-index: 999999 !important;
-}
-</style>

+ 401 - 0
src/views/tourism/membershipManagement/physicalCard/formBox/physicalCardManagementForm.vue

@@ -0,0 +1,401 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="open"
+    width="50%"
+    append-to-body
+    :close-on-click-modal="false"
+    @close="cancel"
+  >
+    <div class="form-dialog-box"
+    v-loading="loading"
+    :element-loading-text="loadingText"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0)">
+      <div
+        v-loading="loading"
+        :element-loading-text="''"
+        element-loading-spinner="''"
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+        >
+        <el-form :model="form" ref="form" :rules="rules" label-width="200px">
+          <div class="form-title"><span>基本信息</span></div>
+          <el-form-item label="办卡类型:" prop="entityCardConfigId">
+            <el-select style="width: 100%;" v-model="form.entityCardConfigId" clearable placeholder="请选择卡类型">
+              <el-option
+                v-for="dict in tableList"
+                :key="dict.id"
+                :label="dict.cardName"
+                :value="dict.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="持卡人:" prop="userName">
+            <el-input v-model="form.userName" controls-position="right" placeholder="请输入持卡人"></el-input>
+          </el-form-item>
+          <el-form-item label="身份证号:" prop="idCard">
+            <el-input v-model="form.idCard" controls-position="right" placeholder="请输入身份证号"></el-input>
+          </el-form-item>
+          <el-form-item label="手机号:" prop="phone">
+            <div style="display: flex;">
+              <el-input v-model="form.phone" controls-position="right" placeholder="请输入手机号"></el-input>
+              <el-button @click="getCode" style="margin-left: 20px;" type="primary" :loading="phoneCodeLoading == 1">{{ phoneCodeLoading == 1 ? '获取中...' : '获取验证码'  }}</el-button>
+            </div>
+          </el-form-item>
+          <el-form-item label="短信验证码:" prop="upIntegral">
+            <el-input v-model="form.upIntegral" controls-position="right" placeholder="请输入短信验证码"></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+    <span slot="footer" class="dialog-footer" v-if="formStatus==1">
+      <el-button @click="cancel">取消</el-button>
+      <el-button
+        type="primary"
+        @click="submitForm"
+        :loading="loading"
+        element-loading-text="提交中..."
+        element-loading-spinner="el-icon-loading"
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+      > 
+        {{ loading ? '提交中...' : '保存' }}
+      </el-button>
+    </span>
+    <!-- 添加或修改对话框 End -->
+  </el-dialog>
+</template>
+
+<script>
+import { 
+  getTableDeatilsByIdApi,
+  updateTableApi,
+  addTableApi,
+  listTableApi,
+ } from '@/api/CURD'
+
+export default {
+  name: "addAndEdit",
+  dicts: [],
+  data() {
+    return {
+      title: "",
+      model: "", // EDIT: 编辑模式 ADD : 新增模式  EDITInit : 编辑模式(需要请求详情)
+      open: false,
+      loading: false,
+      loadingText: "拼命加载数据中...",
+      formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2  : 获取详情失败 
+      configUrl: {
+        add: '/merchant/merchantEntitycard/insertOrUpdate', // 新增地址
+        details: '/merchant/merchantEntitycard/selectById', // 详情地址
+        edit: '/merchant/merchantEntitycard/insertOrUpdate', // 编辑地址
+        list: '/merchant/merchantEntitycardConfig/pageList', // 实体卡类型
+      },
+      form: {
+        id: undefined,
+      },
+      rules: {
+        entityCardConfigId: [{ required: true, message: "请选择办卡类型", trigger: ["change","blur"] }],
+        userName: [{ required: true, message: "请输入持卡人", trigger: ["change","blur"] }],
+        idCard: [{ required: true, message: "请输入身份证号", trigger: ["change","blur"] }],
+        phone: [
+          { required: true, trigger: ["change","blur"], message: "请输入您的账号" },
+          { pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: ["change","blur"] }
+        ],
+        upIntegral: [{ required: true, message: "请输入短信验证码", trigger: ["change","blur"] }],
+      },
+      scenicAreaProducts: [],// 景点产品关联
+
+      tableList: [], // 实体卡类型
+
+      phoneCodeLoading: 0
+    };
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    /** 查询体卡类型列表 */
+    getList() {
+      listTableApi(
+        this.configUrl.list,
+        this.addDateRange({
+          pageNum: 1,
+          pageSize: 9999,
+        })).then(response => {
+              this.tableList = response.data.rows;
+          }
+        ).catch (error=>{
+          this.tableList = [];
+        }) 
+    },
+    async initData(title , model,row){
+      this.title = title
+      this.open = true
+      this.loadingText = "拼命加载数据中..."
+      this.loading = true
+      this.actionUrlLoading = false
+      this.model = model
+      this.formStatus = 0
+      if(model=='ADD') { // 新增
+        this.$set(this,'form',{...row,logo:[]})
+        this.formStatus = 1
+      }else if(model=='EDIT') { // 新增
+        let obj = {
+          ...row,
+          logo: row.logo?row.logo.split(','):[]
+        }
+        this.$set(this,'form',obj)
+        this.formStatus = 1
+      }else if(model=='EDITInit') { // 新增
+        await this.getTableDeatilsFun(row)
+      }
+      this.loading = false
+      this.$nextTick(()=>{
+        if(this.$refs["form"]) {
+          this.$refs["form"].clearValidate();
+        }
+      })
+    },
+    /** 获取详情 */
+    async getTableDeatilsFun(row) {
+      const id = row.id
+      this.loading = true
+      try {
+        let res = await getTableDeatilsByIdApi(this.configUrl.details,{id})
+        if(res.code == 200) {
+          let obj = {
+            ...res.data,
+        }
+          this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
+          this.formStatus = 1
+        }else {
+          this.$message.error('获取详情失败!!!');
+          this.formStatus = 2
+          this.loading = false
+          this.open = false;
+        }
+        this.loading = false
+      } catch (error) {
+        console.error('获取详情失败!!!!',error)
+        this.formStatus = 2
+        this.loading = false
+        this.open = false;
+      }
+    },
+    /**
+     * 保存
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.loadingText = "提交数据中..."
+          this.loading = true
+          if (this.model != 'ADD') {
+            addTableApi(
+              this.configUrl.edit,{
+                ...this.form,
+              }).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.loading = false
+              this.open = false;
+              this.$emit('refresh')
+            }).catch(()=>{
+              this.$message.error("修改失败!!!");
+              this.loading = false
+            })
+          } else {
+            addTableApi(this.configUrl.edit,{
+                ...this.form,
+                logo: this.form.logo ? this.form.logo.join(','):''
+              }).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.loading = false
+              this.open = false;
+              this.$emit('refresh')
+            }).catch(()=>{
+              this.$message.error("新增失败!!!");
+              this.loading = false
+            })
+          }
+        }
+      });
+    },
+    /**
+     * 重置
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    reset() {
+      if(this.$refs["form"]) {
+        this.$refs["form"].clearValidate();
+      }
+    },
+    /**
+     * 关闭弹框
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    cancel() {
+      this.reset();
+      this.open = false;
+    },
+    /**
+     * 获取验证码
+     */
+     getCode() {
+      this.phoneCodeLoading = 1
+      listTableApi(
+        this.configUrl.list,
+        this.addDateRange({
+          pageNum: 1,
+          pageSize: 9999,
+        })).then(response => {
+          this.phoneCodeLoading = 2
+        }).catch (error=>{
+          this.phoneCodeLoading = 0
+        }) 
+     }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.form-dialog-box {
+  padding: 0 30px;
+  padding: 0 30px;
+  min-height: 50vh;
+  max-height: 65vh;
+  overflow-y: auto;
+  >div {
+    width: 100%;
+    min-height: 50vh;
+  }
+  .form-title {
+    padding: 0 0 10px 0;
+    span {
+      display: flex;
+      color: rgba(65,80,88,1);
+      font-size: 16px;
+      font-family: SourceHanSansSC;
+      font-weight: 700;
+      line-height: 23px;
+      border-left: 4px solid rgb(22, 132, 252);
+      padding-left: 10px;
+    }
+    
+  }
+  ::v-deep .ql-editor {
+    height: 400px;
+  }
+  .upload-btn {
+    width: 100px;
+    height: 100px;
+    background-color: #fbfdff;
+    border: dashed 1px #c0ccda;
+    border-radius: 5px;
+    i {
+      font-size: 30px;
+      margin-top: 20px;
+    }
+    &-text {
+      margin-top: -10px;
+    }
+  }
+  .avatar {
+    cursor: pointer;
+  }
+}
+.el-table{
+  .upload-btn {
+    width: 100px;
+    height: 100px;
+    background-color: #fbfdff;
+    border: dashed 1px #c0ccda;
+    border-radius: 5px;
+    i {
+      font-size: 30px;
+      margin-top: 20px;
+    }
+    &-text {
+      margin-top: -10px;
+    }
+  }
+  .avatar {
+    cursor: pointer;
+  }
+}
+
+.area-container {
+  min-height: 400px;
+}
+
+::v-deep .area-wrap-city.el-cascader {
+  line-height: normal;
+  .el-input {
+    cursor: pointer;
+    width: 100% !important;
+    height: 28px !important;
+    .el-input__inner {
+      display: none !important;
+    }
+    span.el-input__suffix {
+      position: inherit !important;
+      i.el-input__icon {
+        line-height: inherit;
+        margin-left: 5px;
+      }
+    }
+
+    .el-input__wrapper {
+      box-shadow: none;
+      input {
+        display: none;
+      }
+    }
+  }
+
+  .el-cascader__tags {
+    display: none;
+  }
+}
+
+.area-city-popper {
+  .el-cascader-panel {
+    .el-scrollbar.el-cascader-menu {
+      .el-cascader-menu__wrap.el-scrollbar__wrap {
+        height: 315px;
+      }
+    }
+  }
+}
+::v-deep .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+  ::v-deep .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+  ::v-deep .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 100px;
+    height: 100px;
+    line-height: 100px;
+    text-align: center;
+  }
+  ::v-deep .avatar {
+    width: 100px;
+    height: 100px;
+    display: block;
+  }
+</style>
+<style>
+.custom-class-box {
+  z-index: 999999 !important;
+}
+</style>

+ 4 - 4
src/views/tourism/membershipManagement/physicalCard/formBox/setIntegralForm.vue

@@ -72,9 +72,9 @@ export default {
       loadingText: "拼命加载数据中...",
       formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2  : 获取详情失败 
       configUrl: {
-        add: '/member/memberInfo/updateCredit', // 新增地址
-        details: '/member/memberInfo/detail', // 详情地址
-        edit: '/member/memberInfo/updateCredit', // 编辑地址
+        add: '/merchant/merchantEntitycardCreditRecord/systemAdd', // 新增地址
+        details: '', // 详情地址
+        edit: '/merchant/merchantEntitycardCreditRecord/systemAdd', // 编辑地址
       },
       form: {
         id: undefined,
@@ -102,7 +102,7 @@ export default {
           ...row
         }
         this.$set(this,'form',{
-          memberId: row.id
+          entityCardId: row.id
         })
         this.formStatus = 1
       }else if(model=='EDITInit') { // 新增

+ 16 - 10
src/views/tourism/membershipManagement/physicalCard/formBox/setStoredValue.vue

@@ -20,10 +20,10 @@
         >
         <el-form :model="form" ref="form" :rules="rules" label-width="120px">
           <el-form-item label="账户余额">
-            <span>{{ form.balance }}</span>
+            <span>{{ form.amount }}</span>
           </el-form-item>
           <el-form-item label="可退余额">
-            <span>{{ form.refundBalance }}</span>
+            <span>{{ form.refundAmount }}</span>
           </el-form-item>
           <el-form-item label="储值变动" prop="type">
             <el-radio-group v-model="form.type">
@@ -78,9 +78,9 @@ export default {
       loadingText: "拼命加载数据中...",
       formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2  : 获取详情失败 
       configUrl: {
-        add: '/member/memberInfo/updateBalance', // 新增地址
-        details: '/member/memberInfo/detail', // 详情地址
-        edit: '/member/memberInfo/updateBalance', // 编辑地址
+        add: '/merchant/merchantEntitycardStorageRecord/systemAdd', // 新增地址
+        details: '/merchant/merchantEntitycard/selectById', // 详情地址
+        edit: '/merchant/merchantEntitycardStorageRecord/systemAdd', // 编辑地址
       },
       form: {
         id: undefined,
@@ -108,9 +108,9 @@ export default {
           ...row
         }
         this.$set(this,'form',{
-          balance: row.balance,
-          refundBalance: row.refundBalance,
-          memberId: row.id 
+          amount: row.amount,
+          refundAmount: row.refundAmount,
+          entityCardId: row.id 
         })
         this.formStatus = 1
       }else if(model=='EDITInit') { // 新增
@@ -162,7 +162,10 @@ export default {
           if (this.model != 'ADD') {
             addTableApi(
               this.configUrl.edit,{
-                ...this.form
+                entityCardId: this.form.entityCardId,
+                type: this.form.type,
+                amount: this.form.num,
+                remark: this.form.remark
               }).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.loading = false
@@ -174,7 +177,10 @@ export default {
             })
           } else {
             addTableApi(this.configUrl.edit,{
-                ...this.form
+                entityCardId: this.form.entityCardId,
+                type: this.form.type,
+                amount: this.form.num,
+                remark: this.form.remark
               }).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.loading = false

+ 1 - 1
src/views/tourism/membershipManagement/physicalCard/physicalCardAllocation.vue

@@ -3,7 +3,7 @@
       <el-row :gutter="20">
         <!--用户数据-->
         <el-col :span="24" :xs="24">
-            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
                 <el-form-item label="实体卡名称" prop="cardName">
                     <el-input
                     v-model="queryParams.cardName"

+ 118 - 49
src/views/tourism/membershipManagement/physicalCard/physicalCardManagement.vue

@@ -4,9 +4,9 @@
         <!--用户数据-->
         <el-col :span="24" :xs="24">
           <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-            <el-form-item label="卡号" prop="realName">
+            <el-form-item label="卡号" prop="cardNo">
               <el-input
-                v-model="queryParams.realName"
+                v-model="queryParams.cardNo"
                 placeholder="请输入卡号"
                 clearable
                 style="width: 240px"
@@ -22,24 +22,24 @@
                 @keyup.enter.native="handleQuery"
               />
             </el-form-item>
-            <el-form-item label="手机号" prop="mobile">
+            <el-form-item label="手机号" prop="phone">
               <el-input
-                v-model="queryParams.mobile"
+                v-model="queryParams.phone"
                 placeholder="请输入手机号"
                 clearable
                 style="width: 240px"
                 @keyup.enter.native="handleQuery"
               />
             </el-form-item>
-            <el-form-item label="卡类型" prop="cardType">
-                <el-select v-model="queryParams.cardType" clearable placeholder="请选择卡类型">
-                  <el-option
-                      v-for="dict in dict.type.tourism_IntegralRecord_cardType"
-                      :key="dict.value"
-                      :label="dict.label"
-                      :value="dict.value">
-                  </el-option>
-                </el-select>
+            <el-form-item label="卡类型" prop="entityCardConfigId">
+              <el-select v-model="queryParams.entityCardConfigId" clearable placeholder="请选择卡类型">
+                <el-option
+                  v-for="dict in tableListCopy"
+                  :key="dict.id"
+                  :label="dict.cardName"
+                  :value="dict.id">
+                </el-option>
+              </el-select>
             </el-form-item>
             <el-form-item>
               <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -48,36 +48,52 @@
           </el-form>
   
           <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+              <el-button
+                type="primary"
+                plain
+                icon="el-icon-plus"
+                size="mini"
+                @click="handleAdd"
+                v-hasPermi="configPermi.add"
+              >添加新卡</el-button>
+            </el-col>
             <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
           </el-row>
   
           <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
             <el-table-column type="index" label="序号" align="center"  />
-            <el-table-column label="卡号" align="center" key="realName" prop="realName" v-if="columns[0].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="持卡人" align="center" key="memberCode" prop="memberCode" v-if="columns[1].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="手机号" align="center" key="mobile" prop="mobile" v-if="columns[4].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="卡类型" align="center" key="cardType" prop="cardType" v-if="columns[5].visible" :show-overflow-tooltip="true">
+            <el-table-column label="卡号" align="center" key="cardNo" prop="cardNo" v-if="columns[0].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="持卡人" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="手机号" align="center" key="phone" prop="phone" v-if="columns[2].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="卡类型" align="center" key="cardName" prop="cardName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="激活时间" align="center" key="effectiveDate" prop="effectiveDate" v-if="columns[4].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="使用期限" align="center" key="useType" prop="useType" v-if="columns[5].visible" :show-overflow-tooltip="true">
               <template slot-scope="scope">
-                <dict-tag :options="dict.type.tourism_IntegralRecord_cardType" :value="scope.row.cardType"/>
+                <span>{{ setUseType(scope.row) }}</span>
               </template>
             </el-table-column>
-            
-            <el-table-column label="激活时间" align="center" key="cardId" prop="cardId" v-if="columns[4].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="使用期限" align="center" key="credit" prop="credit" v-if="columns[5].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="卡余额" align="center" key="balance" prop="balance" v-if="columns[6].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="卡积分" align="center" key="buyCount" prop="buyCount" v-if="columns[7].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="充值余额" align="center" key="consumeTotal" prop="consumeTotal" v-if="columns[8].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="状态" align="center" key="status" prop="status" v-if="columns[9].visible" :show-overflow-tooltip="true">
+            <el-table-column label="卡余额" align="center" key="amount" prop="amount" v-if="columns[6].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="卡积分" align="center" key="credit" prop="credit" v-if="columns[7].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="充值余额" align="center" key="storageAmount" prop="storageAmount" v-if="columns[8].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="卡状态" align="center" key="cardStatus" prop="cardStatus" v-if="columns[9].visible" :show-overflow-tooltip="true">
               <template slot-scope="scope">
-                <dict-tag :options="dict.type.tourism_memberInformation_status" :value="scope.row.status"/>
+                <dict-tag :options="dict.type.tourism_physicalCardManagement_cardStatus" :value="scope.row.cardStatus"/>
               </template>
             </el-table-column>
             <el-table-column label="禁用/启用" align="center" key="status1" prop="status1" v-if="columns[10].visible" :show-overflow-tooltip="true">
               <template slot-scope="scope">
-                <dict-tag :options="dict.type.tourism_memberInformation_status" :value="scope.row.status"/>
+                <switchBox 
+                :defaultChecked="true" 
+                v-model="scope.row.status" 
+                @changeFun="openAttraction(scope.row)" 
+                :disabled="false"
+                :active-value="1"
+                :inactive-value="0"
+                 />
               </template>
             </el-table-column>
-            <el-table-column label="最近消费时间" align="center" key="lastCreateTime" prop="lastCreateTime" v-if="columns[11].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="最近消费时间" align="center" key="newOrderTime" prop="newOrderTime" v-if="columns[11].visible" :show-overflow-tooltip="true" />
             <el-table-column
               label="操作"
               align="center"
@@ -99,9 +115,9 @@
                         v-hasPermi="['system:user:resetPwd']">设置积分</el-dropdown-item>
                         <el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check"
                         v-hasPermi="['system:user:edit']">设置储值</el-dropdown-item>
-                        <el-dropdown-item command="handleAuthRole1" icon="el-icon-circle-check"
+                        <el-dropdown-item command="handleEdit" icon="el-icon-circle-check"
                         v-hasPermi="['system:user:edit']">编辑</el-dropdown-item>
-                        <el-dropdown-item command="handleAuthRole2" icon="el-icon-circle-check"
+                        <el-dropdown-item command="handleResetPassword" icon="el-icon-circle-check"
                         v-hasPermi="['system:user:edit']">重置密码</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown>
@@ -118,6 +134,8 @@
           />
         </el-col>
       </el-row>
+      <!--  新增或修改  -->
+      <addAndEdit ref="addAndEdit" @refresh="getList" />
       <!--  详情 -->
       <detailsBox ref="detailsBox" />
 
@@ -131,14 +149,16 @@
   import { 
     listTableApi, 
     delTableParamsApi,
+    updateTableApi
   } from "@/api/CURD";
-  import detailsBox from "./detailsBox/memberInformationDetails.vue"
+  import addAndEdit from "./formBox/physicalCardManagementForm.vue"
+  import detailsBox from "./detailsBox/physicalCardManagementDetails.vue"
   import setIntegralForm from "./formBox/setIntegralForm.vue"
   import setStoredValue from "./formBox/setStoredValue.vue"
   export default {
     name: "User",
-    dicts: ['tourism_IntegralRecord_cardType','tourism_memberInformation_status'],
-    components: {detailsBox,setIntegralForm,setStoredValue},
+    dicts: ['tourism_IntegralRecord_cardType','tourism_physicalCardManagement_cardStatus'],
+    components: {addAndEdit,detailsBox,setIntegralForm,setStoredValue},
     data() {
       return {
         title: "实体卡管理",// 通用标题
@@ -156,6 +176,9 @@
           upload: '',// 导入地址
           download:'', // 下载模板地址
           export: '',// 导出地址
+          updateStatus: '/merchant/merchantEntitycard/updateStatus', // 编辑地址
+          resetPassword: '/merchant/merchantEntitycard/resetPassword',
+          listCopy: '/merchant/merchantEntitycardConfig/pageList'
         },
         // 遮罩层
         loading: true,
@@ -192,12 +215,28 @@
           { key: 10, label: `禁用/启用`, visible: true },
           { key: 11, label: `最近消费时间`, visible: true },
         ],
+        tableListCopy: []// 实体卡类型
       };
     },
     created() {
+      this.getListCopy()
       this.getList();
     },
     methods: {
+      /** 查询实体卡类型列表 */
+      getListCopy() {
+        listTableApi(
+          this.configUrl.listCopy,
+          this.addDateRange(
+            this.queryParams, 
+            this.dateRange)).then(response => {
+              this.tableListCopy = response.data.rows;
+          }
+        ).catch (error=>{
+          console.error('获取列表失败!!!!',error)
+          this.tableListCopy = [];
+        }) 
+      },
       /** 查询用户列表 */
       getList() {
         this.loading = true;
@@ -290,15 +329,27 @@
       },
       /** 开/闭 园 */
       openAttraction(row) {
-        console.log("row======",row)
-        this.$modal.confirm(`是否确认${row.status == 2 ? '关闭' : '打开'} ${row.name}园区吗?`).then( () => {
-          return addTableApi(this.configUrl.edit,{
-            ...row,
-            status: row.status == 1 ? 2 : 1
+        this.$modal.confirm(`是否确认${row.status == 0 ? '启用' : '禁用'} ${row.cardNo||''}吗?`).then( () => {
+          return updateTableApi(this.configUrl.updateStatus,{
+            id: row.id,
+            status: row.status == 1 ? 0 : 1
+          });
+        }).then(() => {
+          this.getList();
+          this.$modal.msgSuccess(`${row.status == 0 ? '启用' : '禁用'}成功`);
+        }).catch((e) => {
+          console.error("失败====",e)
+        });
+      },
+      /**  重置密码   */
+      handleResetPassword(row){
+        this.$modal.confirm(`是否确认重置卡号 ${row.cardNo||''}的密码为000000吗?`).then( () => {
+          return updateTableApi(this.configUrl.resetPassword,{
+            id: row.id,
           });
         }).then(() => {
           this.getList();
-          this.$modal.msgSuccess(`${row.status == 1 ? '打开' : '关闭'}成功`);
+          this.$modal.msgSuccess(`重置成功`);
         }).catch((e) => {
           console.error("失败====",e)
         });
@@ -315,16 +366,34 @@
         },
         // 更多操作触发
         handleCommand(command, row) {
-        switch (command) {
-            case "handleResetPwd":
-            this.handleResetPwd(row);
-            break;
-            case "handleAuthRole":
-            this.handleAuthRole(row);
-            break;
-            default:
-            break;
-        }
+          switch (command) {
+              case "handleResetPwd":
+              this.handleResetPwd(row);
+              break;
+              case "handleAuthRole":
+              this.handleAuthRole(row);
+              break;
+              case "handleEdit":
+              this.handleUpdate(row);
+              break;
+              case "handleResetPassword":
+              this.handleResetPassword(row);
+              break;
+              default:
+              break;
+          }
+        },
+        /** 设置使用期限  */
+        setUseType(row){
+          if(row.useType == 1) {
+            return '永久生效'
+          }else if(row.useType == 2) {
+            return '' + (row.useDay || '') + '天有效'
+          }else if(row.useType == 3) {
+            return '' + row.useEndDay + '内有效'
+          }else{
+            return '--'
+          }
         },
     }
   };