Browse Source

Merge branch 'master' of http://dzgogs.hw.hongweisoft.com/tourism_project/tourism_merchant_ui

aleyds 11 months ago
parent
commit
a87922a9ec

+ 521 - 0
src/myComponents/selectMoreBox.vue

@@ -0,0 +1,521 @@
+<template>
+    <div class="select-more-box">
+        
+        <div class="select-more-item">
+            <div class="c_left_tag" v-if="modalDetails.length>0">
+                <el-tag class="tag" size="closable" v-for="(item, index) in modalDetails" :key="index"
+                    @close="handleCloseCopy(item)" closable>
+                    {{ item.name }}
+                    </el-tag>
+            </div>
+            <span style="color: #c0c0c0;" v-else>{{ placeholder }}</span>
+            <div class="select-more-tool" v-if="isAdd">
+                <span>目前已选择:{{ modalDetails.length }}个</span>
+                <div class="select-more-but-add" @click="dialogVisible = true"><span>添加</span><span>+</span></div>
+                <div class="select-more-but-clear" @click="clearModalDetails"><span>清除已选</span></div>
+            </div>
+        </div>
+        <el-dialog 
+        append-to-body 
+        :title="title" 
+        :visible.sync="dialogVisible" 
+        @open="dialogOpen" 
+        @close="dialogClose"
+        :close-on-click-modal="false"
+        :destroy-on-close="true" 
+        width="900px" 
+        class="information-dialog"
+        custom-class="template-con-dialog" top="auto">
+            <div class="form-con" v-loading="loading">
+                <div class="form_content">
+                    <!-- left -->
+                    <div class="c_left">
+                        <div class="c_left_btn">
+                            <div>已选成员</div>
+                            <el-button type="text" @click="clearUser">清空</el-button>
+                        </div>
+                        <div class="c_left_tag">
+                            <el-tag class="tag" size="closable" v-for="(item, index) in nameList" :key="index"
+                                @close="handleClose(item)" closable>
+                                {{ item.name }}
+                            </el-tag>
+                        </div>
+                    </div>
+                    <!-- right -->
+                    <div class="c_right">
+                        <div class="c_input">
+                            <el-input size="mini" prefix-icon="el-icon-search" v-model="userValue" placeholder="输入搜索"></el-input>
+                            <el-button style="margin-left: 10px;" size="mini" @click="searchFun(false)">
+                                重置
+                            </el-button>
+                            <el-button size="mini" @click="searchFun(true)" type="primary">
+                                搜索
+                            </el-button>
+                        </div>
+                        <div class="c_checkbox" v-loading="listLoading">
+                            <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll"
+                                @change="handleCheckAllChange">全选当前页</el-checkbox>
+                           <div style="margin: 15px 0;"></div>
+                            <div class="c_checkbox_item" v-for="(item, index) in dataList" :key="index">
+                                <el-checkbox 
+                                class="checkBox_item" 
+                                v-model="item.checked"
+                                @change="(val)=>changeCheckbox(item,index,val)"
+                                    :key="index">{{
+                                        item.name
+                                    }}</el-checkbox>
+                            </div>
+                            
+                        </div>
+                        <div class="c_pagination">
+                            <el-pagination
+                            v-if="!listLoading"
+                            small
+                            background
+                            layout="total, prev, pager, next"
+                            :page-sizes="page.pageSizes"
+                            :page-size="page.pageSize"
+                            :total="page.total"
+                            :current-page="page.pageNum"
+                            @size-change="handleSizeChange"
+                            @current-change="handleCurrentChange"
+                            >
+                            </el-pagination>
+                        </div>
+                    </div>
+                </div>
+    
+                <div class="drawer-footer">
+                    <el-button @click="dialogVisible = false">
+                        取消
+                    </el-button>
+                    <el-button @click="submitForm()" type="primary">
+                        确定
+                    </el-button>
+                </div>
+            </div>
+        </el-dialog>
+    </div>
+    
+</template>
+  
+<script>
+import { 
+    listTableApi, 
+  } from "@/api/CURD";
+export default {
+    props: {
+        title: {
+            type: String,
+            default: '新增',
+        },
+        value: {
+            type: Array,
+            default: ()=>{
+                return []
+            },
+        },
+        idKey: { // 绑定的iD
+            type: String,
+            default: 'id',
+        },
+        nameKey: { // 展示的字段名称
+            type: String,
+            default: 'name',
+        },
+        isAdd: { // 是否展示新增
+            type: Boolean,
+            default: true,
+        },
+        selectKey: { // 查询参数
+            type: String,
+            default: 'name',
+        },
+        pageSizeKey: { // 分页参数
+            type: String,
+            default: 'pageSize',
+        },
+        pageNumKey: { // 分页参数
+            type: String,
+            default: 'pageNum',
+        },
+        listUrl: { // 列表查询接口地址
+            type: String,
+            default: '',
+        },
+        params: { // 默认条件
+            type: Object,
+            default: ()=>{
+                return {}
+            },
+        },
+        limit: { // 限制选择的条数
+            type: Number,
+            default: -1, // -1 表示不限
+        },
+        placeholder: {
+            type: String,
+            default: '请点击添加',
+        }
+    },
+    data() {
+        return {
+            dialogVisible: false, //弹窗选择
+            userValue: '', //人员搜索
+            dataList: [], //数据列表集合
+            nameList: [],//已选择人员
+            checkAll: false,
+            checkedUsers: [], // 选中的
+            isIndeterminate: false,
+            modalDetails: [],
+            loading: false,// 
+            page: {
+                pageSizes: [100, 200, 300, 400],
+                pageSize: 10,
+                pageNum: 1,
+                total: 0,
+            },
+            listLoading: false,
+        }
+    },
+    watch: {
+        value: {
+            handler(newValue){
+                console.log("dfsdsfsdf====",this.value)
+                if(this.value) {
+                    this.modalDetails = JSON.parse(JSON.stringify(this.value))
+                }else {
+                    this.modalDetails = []
+                }
+            },
+            immediate: true
+        }
+    },
+    methods: {
+        // 弹窗组件显示事件
+        async dialogOpen() {
+            this.loading = true
+            this.listLoading = false
+            this.userValue = ''
+            this.$set(this.page,'pageNum',1)
+            if (this.modalDetails.length) {
+                this.modalDetails.forEach((item) => {
+                    this.checkedUsers.push(item.id)
+                })
+                this.nameList = this.modalDetails//已选择人员
+                this.checkAll = false
+                this.isIndeterminate = false
+                this.userValue = '' //人员搜索
+            } else {
+                this.nameList = []//已选择人员
+                this.checkAll = false
+                this.checkedUsers = [] // 选中的
+                this.isIndeterminate = false
+                this.userValue = '' //人员搜索
+            }
+            await this.listUser()
+            this.loading = false
+        },
+        /**  搜索   */
+        searchFun(type) {
+            this.listLoading = true
+            if(!type) {
+                this.userValue = ''
+            }
+            this.listUser()
+        },
+        // 查询支部人员集合
+        async listUser() {
+            try {
+                this.dataList = []
+                let res = await listTableApi(this.listUrl,{
+                    ...this.params,
+                    [this.selectKey]: this.userValue,
+                    [this.pageNumKey]: this.page.pageNum,
+                    [this.pageSizeKey]: this.page.pageSize
+                })
+                if (res.code == 200) {
+                    let list = []
+                    let listId = []
+                    this.nameList.forEach((item1,index1)=>{
+                        listId.push(item1.id)
+                    })
+                    res.data.rows.forEach((item,index)=>{
+                        list.push({
+                            ...item,
+                            id: item[this.idKey],
+                            name: item[this.nameKey],
+                            checked: listId.includes(item[this.idKey])
+                        })
+                    })
+                    this.dataList = list
+                    this.$set(this.page,'total',res.data.total)
+                } else {
+                    this.$message({
+                        type: 'error',
+                        message: res.msg
+                    });
+                }
+                this.checkedCurrentPageAll()
+                this.listLoading = false
+            } catch (error) {
+                this.checkedCurrentPageAll()
+                this.loading = false
+                this.listLoading = false
+                this.dialogVisible = false
+            }
+        },
+        // 清空按钮
+        clearUser() {
+            this.handleCheckAllChange(false)
+            this.isIndeterminate = false;
+            this.checkAll = false
+        },
+        // 清除全部
+        clearModalDetails() {
+            this.$emit('input', [])
+            this.$emit('submitForm')
+        },
+        // 单项删除已选按钮 (外部)
+        handleCloseCopy(item) {
+            let arr = this.modalDetails.filter((item1) => {
+                return item.id != item1.id
+            })
+            this.$emit('input', arr)
+            this.$emit('submitForm')
+        },
+        // 单项删除已选按钮 (备选)
+        handleClose(item) {
+            let arr = this.nameList.filter((item1) => {
+                return item.id != item1.id
+            })
+            let listId = []
+            arr.forEach((item,index) => {
+                listId.push(item.id)
+            })
+            let list = JSON.parse(JSON.stringify(this.dataList))
+            list.forEach((item,index) => {
+                list[index].checked = listId.includes(item.id)
+            })
+            this.nameList = arr
+            this.dataList = list
+            this.checkedCurrentPageAll()
+        },
+        // 全选当前页按钮
+        handleCheckAllChange(val) {
+            // if(this.limit != -1 ) {
+            //     if(this.dataList.length)
+            // }
+
+            let list = JSON.parse(JSON.stringify(this.dataList))
+            let listId = []
+            list.forEach((item,index) => {
+                list[index].checked = val
+                listId.push(item.id)
+            })
+            let listExist = this.nameList.filter((item,index)=>{
+                return !listId.includes(item.id)
+            })
+            list.forEach((item,index) => {
+                if(item.checked) {
+                    listExist.push({
+                        ...item
+                    })
+                } 
+            })
+            this.dataList = list
+            this.nameList = listExist
+            this.isIndeterminate = false;
+        },
+        /** 检测当前页是否全选  */
+        checkedCurrentPageAll() {
+            let length = 0
+            let list = JSON.parse(JSON.stringify(this.dataList))
+            list.forEach((item,index) => {
+                if(item.checked) {
+                    length++
+                }
+            })
+            this.checkAll = (length == list.length)&& length != 0
+        },
+        // 弹窗组件关闭事件
+        dialogClose() {
+        },
+        // 提交表单事件
+        submitForm() {
+            this.$emit('input', JSON.parse(JSON.stringify(this.nameList)))
+            this.$emit('submitForm')
+            this.dialogVisible = false
+        },
+        /** 调整每页选择条数  */
+        handleSizeChange(val) {
+        },
+        /** 点击页码  */
+        handleCurrentChange(val) {
+            this.listLoading = true
+            this.listUser()
+        },
+        /** 选择列表  */
+        changeCheckbox(item,index,val) {
+            if(val){
+                this.nameList.push({
+                    ...item
+                })
+            }else {
+                let i = -1
+                this.nameList.forEach((item1,index)=>{
+                    if(item1.id == item.id) {
+                        i = index
+                    }
+                })
+                if(i!=-1) {
+                    this.nameList.splice(i,1)
+                }
+            }
+            this.checkedCurrentPageAll()
+        }
+ 
+    },
+}
+</script>
+  
+<style lang="scss" scoped>
+.is-error {
+    .select-more-item {
+        border-color: #f56c6c !important;
+    }
+}
+.select-more-tool {
+    position: absolute;
+    bottom: 5px;
+    right: 5px;
+    display: flex;
+    .select-more-but-add {
+        width: 80px;
+        height: 36px;
+        box-sizing: border-box;
+        color: #fff;
+        background-color: #409eff;
+        border-color: #409eff;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        border-radius: 5px;
+        cursor: pointer;
+        margin-left: 10px;
+        
+    }
+    .select-more-but-clear {
+        width: 80px;
+        height: 36px;
+        box-sizing: border-box;
+        color: #fff;
+        background-color: #f56c6c;
+        border-color: #f56c6c;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        border-radius: 5px;
+        cursor: pointer;
+        margin-left: 10px;
+    }
+}
+
+.select-more-item {
+    width: 100%;
+    height: 150px;
+    border: 1px solid #C0C4CC;
+    overflow: hidden;
+    overflow-y: auto;
+    border-radius: 5px;
+    margin-top: 5px;
+    position: relative;
+    padding: 10px;
+    .c_left_tag {
+        display: flex;
+        flex-wrap: wrap;
+    }
+ 
+            .tag {
+                margin-left: 0 !important;
+                margin-right: 10px;
+                margin-bottom: 10px;
+            }
+}
+.form-con {
+    padding-top: 10px;
+    margin: auto;
+ 
+    .form_content {
+        height: 500px;
+        display: flex;
+ 
+        .c_left {
+            width: 50%;
+            border-right: 1px solid #EBEEF5;
+            padding: 0 10px;
+ 
+            .c_left_btn {
+                height: 32px;
+                display: flex;
+                justify-content: space-between;
+                align-items: center;
+            }
+ 
+            .c_left_tag {
+                margin-top: 10px;
+                display: flex;
+                flex-wrap: wrap;
+            }
+ 
+            .tag {
+                margin-left: 0 !important;
+                margin-right: 10px;
+                margin-bottom: 10px;
+            }
+ 
+        }
+ 
+        .c_right {
+            width: 50%;
+            height: 100%;
+            padding: 0 10px;
+            display: flex;
+            flex-direction: column;
+            justify-content: space-between;
+            box-sizing: border-box;
+            .c_input {
+                height: 32px;
+                flex-shrink: 0;
+                display: flex;
+                align-items: center;
+            }
+            .c_checkbox {
+                margin-top: 10px;
+                height: 100%;
+                .c_checkbox_item {
+                    width: 100%;
+                    margin-bottom: 5px;
+                }
+            }
+ 
+            .checkBox {
+                display: flex;
+                flex-direction: column;
+                
+                .checkBox_item {
+                    height: 30px;
+                    display: flex;
+                    align-items: center;
+                }
+            }
+            .c_pagination {
+                height: 32px;
+                flex-shrink: 0;
+                display: flex;
+                justify-content: center;
+            }
+        }
+    }
+}
+</style>

+ 8 - 8
src/views/tourism/marketingActivities/couponAllocationSet.vue

@@ -16,7 +16,7 @@
                     <el-radio :label="2">开启</el-radio>
                 </el-radio-group>
             </el-form-item>
-            <el-form-item label="优惠:" v-if="form.isIndex == 2" prop="indexSendVoList">
+            <el-form-item label="优惠:" v-if="form.isIndex == 2" prop="indexSendVoList">
                 <selectMoreBox 
                     v-model="form.indexSendVoList"
                     listUrl="/merchant/merchantCouponInfo/pageList"
@@ -25,7 +25,7 @@
                     :params="{
                         status: 2
                     }"
-                    title="新增优惠" 
+                    title="新增优惠" 
                     placeholder="请点击添加,选择优惠券"
                     @submitForm="()=>$refs.form.validateField('indexSendVoList')">
                 </selectMoreBox>
@@ -37,7 +37,7 @@
                     <el-radio :label="2">开启</el-radio>
                 </el-radio-group>
             </el-form-item>
-            <el-form-item label="优惠:" v-if="form.isZone == 2" prop="zoneSendVoList">
+            <el-form-item label="优惠:" v-if="form.isZone == 2" prop="zoneSendVoList">
                 <selectMoreBox 
                     v-model="form.zoneSendVoList"
                     listUrl="/merchant/merchantCouponInfo/pageList"
@@ -47,7 +47,7 @@
                         status: 2
                     }"
                     placeholder="请点击添加,选择优惠券"
-                    title="新增优惠" 
+                    title="新增优惠" 
                     @submitForm="()=>$refs.form.validateField('zoneSendVoList')">
                 </selectMoreBox>
             </el-form-item>
@@ -64,7 +64,7 @@
                     <el-radio :label="2">开启</el-radio>
                 </el-radio-group>
             </el-form-item>
-            <el-form-item label="优惠:" v-if="form.isPlay == 2" prop="playSendVoList">
+            <el-form-item label="优惠:" v-if="form.isPlay == 2" prop="playSendVoList">
                 <selectMoreBox 
                     v-model="form.playSendVoList"
                     listUrl="/merchant/merchantCouponInfo/pageList"
@@ -74,7 +74,7 @@
                         status: 2
                     }"
                     placeholder="请点击添加,选择优惠券"
-                    title="新增优惠" 
+                    title="新增优惠" 
                     @submitForm="()=>$refs.form.validateField('playSendVoList')">
                 </selectMoreBox>
             </el-form-item>
@@ -85,7 +85,7 @@
                     <el-radio :label="2">开启</el-radio>
                 </el-radio-group>
             </el-form-item>
-            <el-form-item label="优惠:" v-if="form.isOpen == 2" prop="openSendVoList">
+            <el-form-item label="优惠:" v-if="form.isOpen == 2" prop="openSendVoList">
                 <selectMoreBox 
                     v-model="form.openSendVoList"
                     listUrl="/merchant/merchantCouponInfo/pageList"
@@ -95,7 +95,7 @@
                         status: 2
                     }"
                     placeholder="请点击添加,选择优惠券"
-                    title="新增优惠" 
+                    title="新增优惠" 
                     @submitForm="()=>$refs.form.validateField('openSendVoList')">
                 </selectMoreBox>
             </el-form-item>

+ 2 - 2
src/views/tourism/marketingActivities/couponManagement.vue

@@ -13,10 +13,10 @@
                 @keyup.enter.native="handleQuery"
               />
             </el-form-item>
-            <el-form-item label="优惠名称" prop="couponName" label-width="88px">
+            <el-form-item label="优惠名称" prop="couponName" label-width="88px">
               <el-input
                 v-model="queryParams.couponName"
-                placeholder="请输入优惠名称"
+                placeholder="请输入优惠名称"
                 clearable
                 style="width: 240px"
                 @keyup.enter.native="handleQuery"

+ 1 - 1
src/views/tourism/marketingActivities/couponVerification.vue

@@ -119,7 +119,7 @@
     components: {detailsBox},
     data() {
       return {
-        title: "优惠核销",// 通用标题
+        title: "优惠核销",// 通用标题
         configPermi: {
           add: [''], // 新增权限
           details: ['electronicMembership:memberInformation:details'], // 详情权限

+ 239 - 62
src/views/tourism/marketingActivities/detailsBox/eventManagementDetails.vue

@@ -18,56 +18,90 @@
         element-loading-spinner="''"
         element-loading-background="rgba(0, 0, 0, 0.8)"
         >
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+          <el-tab-pane label="基本信息:" name="first"></el-tab-pane>
+        </el-tabs>
         <el-form :model="form" ref="form" :rules="rules" label-width="120px">
-          <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.memberCode }}</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 v-show="activeName == 'first'">
+              <el-form-item label="活动名称:" prop="activityName">
+                <span>{{ form.activityName }}</span>
+              </el-form-item>
+              <el-form-item label="封面:" prop="image">
+                <div style="display: flex;">
+                  <div 
+                  v-for="(item,index) in form.image" 
+                  :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.image">
+                    </el-image>
+                  </div>
+                  <div 
+                  style="width: 100px; height: 100px;" 
+                  v-if="!form.image||form.image.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>建议尺寸375px X 392px,支持jpg/png/gif,支持1MB大小以内的图片上传</span>
+              </el-form-item>
+              <el-form-item label="活动起止时间:" prop="eventTime">
+                <span>{{ form.eventTime && form.eventTime.join('—') }}</span>
+              </el-form-item>
+              <el-form-item label="选择模板:" prop="templateId">
+                <span>{{ form.tempInfo && form.tempInfo.templateName }}</span>
+              </el-form-item>
+              
+              <el-form-item label="优惠券:" prop="couponVoList">
+                <selectMoreBox 
+                    v-model="form.couponVoList"
+                    title="新增优惠券" 
+                    listUrl="/merchant/merchantCouponInfo/pageList"
+                    nameKey="couponName"
+                    selectKey="couponName"
+                    :params="{
+                        status: 2
+                    }"
+                    :isAdd="false"
+                    @submitForm="()=>$refs.form.validateField('couponVoList')">
+                </selectMoreBox>
+              </el-form-item>
+              <el-form-item label="景区门票:" prop="performVoList">
+                <selectMoreBox 
+                    v-model="form.performVoList"
+                    title="新增景区门票" 
+                    listUrl="/merchant/merchantPerformAuditorium/merchantPerformList"
+                    nameKey="name"
+                    selectKey="name"
+                    idKey="performId"
+                    :params="{
+                        status: 1
+                    }"
+                    :isAdd="false"
+                    @submitForm="()=>$refs.form.validateField('performVoList')">
+                </selectMoreBox>
+              </el-form-item>
           </div>
         </el-form>
       </div>
@@ -82,11 +116,17 @@
 <script>
 import { 
   getTableDeatilsByIdApi,
+  updateTableApi,
+  addTableApi,
+  listTableApi,
  } from '@/api/CURD'
-
+import selectCouponManagement from '../model/selectCouponManagement.vue'
+import selectTicketOrders from "../model/selectTicketOrders.vue"
+import selectMoreBox from '@/myComponents/selectMoreBox.vue';
 export default {
   name: "addAndEdit",
-  dicts: ['tourism_memberInformation_sex','tourism_memberInformation_user_type'],
+  components: {selectCouponManagement,selectTicketOrders,selectMoreBox},
+  dicts: ['tourism_couponManagement_type','tourism_couponManagement_useUserType','tourism_couponManagement_receiveType','tourism_couponManagement_useConfig','goods_type'],
   data() {
     return {
       title: "",
@@ -96,35 +136,58 @@ export default {
       loadingText: "拼命加载数据中...",
       formStatus: null, // 0/null : 加载中 1 : 获取详情成功 2  : 获取详情失败 
       configUrl: {
-        add: '', // 新增地址
-        details: '/member/memberInfo/detail', // 详情地址
-        edit: '', // 编辑地址
+        list: '/merchant/merchantTemplate/pageList', // 列表地址
+        add: '/merchant/merchantActivityInfo/insertOrUpdate', // 新增地址
+        details: '/merchant/merchantActivityInfo/selectById', // 详情地址
+        edit: '/merchant/merchantActivityInfo/insertOrUpdate', // 编辑地址
       },
       form: {
         id: undefined,
       },
-      rules: {},
-      scenicAreaProducts: [],// 景点产品关联
+      rules: {
+        activityName: [{ required: true, message: "请输入活动名称", trigger: ["change","blur"] }],
+        image: [{ required: true, message: "请上传封面", trigger: ["change","blur"] }],
+        eventTime: [{ required: true, message: "请选择活动起止时间", trigger: ["change","blur"] }],
+        templateId: [{ required: true, message: "请选择模板", trigger: ["change","blur"] }],
+        couponVoList: [{ required: true, message: "请选择优惠券", trigger: ["change","blur"] }],
+        performVoList: [{ required: true, message: "请选择景区门票", trigger: ["change","blur"] }],
+      },
+
+      activeName: 'first',
+
+      actionUrl: process.env.VUE_APP_BASE_API + process.env.VUE_APP_UPLOAD_IMAGE,
+      actionUrlLoading: false,
+
+      templateIdList: []
     };
   },
   methods: {
     async initData(title , model,row){
       this.title = title
+      this.activeName = 'first'
       this.open = true
       this.loadingText = "拼命加载数据中..."
       this.loading = true
-      this.actionUrlLoading = false
       this.model = model
       this.formStatus = 0
+      this.getJsonObjList()
       if(model=='ADD') { // 新增
-        this.$set(this,'form',{...row,imgUrl:[]})
+        this.$set(this,'form',{
+          ...row,
+          eventTime: [], // 活动时间段
+          image: [],
+          couponVoList: [],
+          performVoList: [],
+        })
         this.formStatus = 1
       }else if(model=='EDIT') { // 新增
         let obj = {
           ...row,
-          imgUrl: row.imgUrl?row.imgUrl.split(','):[]
+          image: row.image?row.image.split(','):[],
         }
-        this.$set(this,'form',obj)
+        this.$set(this,'form',{
+          memberId: row.id
+        })
         this.formStatus = 1
       }else if(model=='EDITInit') { // 新增
         await this.getTableDeatilsFun(row)
@@ -145,8 +208,9 @@ export default {
         if(res.code == 200) {
           let obj = {
             ...res.data,
-            imgUrl: res.data.imgUrl?res.data.imgUrl.split(','):[],
-        }
+            eventTime: [res.data.startDate,res.data.endDate], // 发放时间段
+            image: res.data.image?res.data.image.split(','):[],
+          }
           this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
           this.formStatus = 1
         }else {
@@ -163,6 +227,84 @@ export default {
         this.open = false;
       }
     },
+    /** 查询模板列表 */
+    async getJsonObjList() {
+      try {
+        let res = await listTableApi(this.configUrl.list,{
+          pageNum: 1,
+          pageSize: 999
+        })
+        if(res.code == 200) {
+          this.templateIdList = res.data.rows;
+        }
+      } catch (error) {
+        this.loading = false
+        this.open = false;
+      }
+    },
+    /**
+     * 保存
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    submitForm() {
+      this.$refs["form"].validate((valid ,object)=> {
+        if (valid) {
+          this.loadingText = "提交数据中..."
+          this.loading = true
+          let param = JSON.parse(JSON.stringify(this.form))
+          param['startDate'] = param.eventTime[0]
+          param['endDate'] = param.eventTime[1]
+
+          param['couponIdList'] = this.form.couponVoList.map((item)=> item.id)
+          param['performIdList'] = this.form.performVoList.map((item)=> item.id)
+
+          delete param.eventTime
+          delete param.couponVoList
+          delete param.performVoList
+          if (this.model != 'ADD') {
+            addTableApi(
+              this.configUrl.edit,{
+                ...param,
+                image: param.image ? param.image.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,{
+                ...param,
+                image: param.image ? param.image.join(','):'',
+              }).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.loading = false
+              this.open = false;
+              this.$emit('refresh')
+            }).catch(()=>{
+              this.$message.error("新增失败!!!");
+              this.loading = false
+            })
+          }
+        }else {
+          console.log("fsdfsd===",valid,object)
+          if(object&&JSON.stringify(object)!='{}') {
+            let srt = ''
+            for(let key in object) {
+              if(object.hasOwnProperty(key)) {
+                srt = srt + `[${object[key][0].message}],`
+              }
+            }
+            this.$message.error(srt);
+          }
+          
+        }
+      });
+    },
     /**
      * 重置
      * @date 2023-11-22
@@ -182,6 +324,40 @@ export default {
       this.reset();
       this.open = false;
     },
+    /**  点击tab  */
+    handleClick() {
+
+    },
+    /**  上传图片 单张  */
+    handleAvatarSuccess(response, file, fileList) {
+      console.log("res, file",response, file, fileList)
+      this.actionUrlLoading = false
+      if(response.code == 200) {
+        this.form.image.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.image.splice(index,1)
+    },
   },
 };
 </script>
@@ -295,6 +471,7 @@ export default {
     }
   }
 }
+
 ::v-deep .avatar-uploader .el-upload {
     border: 1px dashed #d9d9d9;
     border-radius: 6px;

+ 5 - 13
src/views/tourism/marketingActivities/eventManagement.vue

@@ -109,7 +109,7 @@
     components: {detailsBox,addAndEdit},
     data() {
       return {
-        title: "优惠券管理",// 通用标题
+        title: "活动管理",// 通用标题
         configPermi: {
           add: [''], // 新增权限
           details: ['electronicMembership:memberInformation:details'], // 详情权限
@@ -148,17 +148,10 @@
         dateRange: [],
         // 控制列表是否显示
         columns: [
-          { key: 0, label: `优惠券名称`, visible: true },
-          { key: 1, label: `券种类型`, visible: true },
-          { key: 2, label: `券种说明`, visible: true },
-          { key: 2.5, label: `发放数量`, visible: true },
-          { key: 3, label: `适用对象`, visible: true },
-          { key: 4, label: `领取限制`, visible: true },
-          { key: 5, label: `使用有效期`, visible: true },
-          { key: 6, label: `适用产品`, visible: true },
-          { key: 7, label: `已领取统计`, visible: true },
-          { key: 8, label: `创建时间`, visible: true },
-          { key: 9, label: `禁用/启用`, visible: true },
+          { key: 0, label: `活动名称`, visible: true },
+          { key: 1, label: `活动起止时间`, visible: true },
+          { key: 2, label: `状态`, visible: true },
+          { key: 2.5, label: `创建时间`, visible: true },
         ],
       };
     },
@@ -225,7 +218,6 @@
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;
-        return
         this.$modal.confirm('是否确认删除数据项?').then( () => {
           return delTableParamsApi(this.configUrl.delect,{
             id: ids

+ 3 - 1
src/views/tourism/marketingActivities/formBox/couponManagementForm.vue

@@ -44,7 +44,7 @@
                   <el-form-item label="" prop="buyAmount">
                     <el-input-number v-model="form.buyAmount" controls-position="right" :min="0" placeholder="请输入"></el-input-number>
                   </el-form-item>
-                  <span>减</span>
+                  <span>{{ form.type == 1 ? '':'打' }}</span>
                   <el-form-item label="" prop="quota">
                     <el-input-number v-model="form.quota" controls-position="right" :min="0" placeholder="请输入"></el-input-number>
                   </el-form-item>
@@ -374,7 +374,9 @@ export default {
           }
           if(obj.useType == 1) {
             obj['useDate'] = [res.data.useStartDate,res.data.useEndDate] // 使用指定时间
+            obj['useDay'] =  undefined
           }else if(obj.useType == 2){
+            obj['useDate'] = []
             obj['useDay'] = obj.useDay
           }
           if(obj.useUserType == 2) {

+ 43 - 32
src/views/tourism/marketingActivities/formBox/eventManagementForm.vue

@@ -26,7 +26,7 @@
               <el-form-item label="活动名称:" prop="activityName">
                 <el-input style="width: 350px;" v-model="form.activityName" placeholder="请输入活动名称" maxlength="50" show-word-limit />
               </el-form-item>
-              <el-form-item label="封面" prop="image">
+              <el-form-item label="封面" prop="image">
                 <div style="display: flex;">
                   <div 
                   v-for="(item,index) in form.image" 
@@ -79,10 +79,10 @@
                   end-placeholder="结束日期">
                 </el-date-picker>
               </el-form-item>
-              <el-form-item label="选择模板:" prop="jsonObj">
-                <el-select style="width: 100%;" v-model="form.jsonObj" placeholder="请选择模板">
+              <el-form-item label="选择模板:" prop="templateId">
+                <el-select style="width: 100%;" v-model="form.templateId" placeholder="请选择模板">
                   <el-option
-                    v-for="item in jsonObjList"
+                    v-for="item in templateIdList"
                     :key="item.id"
                     :label="item.name"
                     :value="item.id">
@@ -90,19 +90,32 @@
                 </el-select>
               </el-form-item>
               
-              <el-form-item label="优惠券:" prop="useUserRelid_2">
-                <selectCouponManagement 
-                    v-model="form.useUserRelid_2"
+              <el-form-item label="优惠券:" prop="couponVoList">
+                <selectMoreBox 
+                    v-model="form.couponVoList"
                     title="新增优惠券" 
-                    @submitForm="()=>$refs.form.validateField('useUserRelid_2')">
-                </selectCouponManagement>
+                    listUrl="/merchant/merchantCouponInfo/pageList"
+                    nameKey="couponName"
+                    selectKey="couponName"
+                    :params="{
+                        status: 2
+                    }"
+                    @submitForm="()=>$refs.form.validateField('couponVoList')">
+                </selectMoreBox>
               </el-form-item>
-              <el-form-item label="景区门票:" prop="useUserRelid_3">
-                <selectTicketOrders 
-                    v-model="form.useUserRelid_3"
+              <el-form-item label="景区门票:" prop="performVoList">
+                <selectMoreBox 
+                    v-model="form.performVoList"
                     title="新增景区门票" 
-                    @submitForm="()=>$refs.form.validateField('useUserRelid_3')">
-                </selectTicketOrders>
+                    listUrl="/merchant/merchantPerformAuditorium/merchantPerformList"
+                    nameKey="name"
+                    selectKey="name"
+                    idKey="performId"
+                    :params="{
+                        status: 1
+                    }"
+                    @submitForm="()=>$refs.form.validateField('performVoList')">
+                </selectMoreBox>
               </el-form-item>
           </div>
         </el-form>
@@ -132,11 +145,10 @@ import {
   addTableApi,
   listTableApi,
  } from '@/api/CURD'
-import selectCouponManagement from '../model/selectCouponManagement.vue'
-import selectTicketOrders from "../model/selectTicketOrders.vue"
+import selectMoreBox from '@/myComponents/selectMoreBox.vue';
 export default {
   name: "addAndEdit",
-  components: {selectCouponManagement,selectTicketOrders},
+  components: {selectMoreBox},
   dicts: ['tourism_couponManagement_type','tourism_couponManagement_useUserType','tourism_couponManagement_receiveType','tourism_couponManagement_useConfig','goods_type'],
   data() {
     return {
@@ -159,9 +171,9 @@ export default {
         activityName: [{ required: true, message: "请输入活动名称", trigger: ["change","blur"] }],
         image: [{ required: true, message: "请上传封面", trigger: ["change","blur"] }],
         eventTime: [{ required: true, message: "请选择活动起止时间", trigger: ["change","blur"] }],
-        jsonObj: [{ required: true, message: "请选择模板", trigger: ["change","blur"] }],
-        useUserRelid_2: [{ required: true, message: "请选择优惠券", trigger: ["change","blur"] }],
-        useUserRelid_3: [{ required: true, message: "请选择景区门票", trigger: ["change","blur"] }],
+        templateId: [{ required: true, message: "请选择模板", trigger: ["change","blur"] }],
+        couponVoList: [{ required: true, message: "请选择优惠券", trigger: ["change","blur"] }],
+        performVoList: [{ required: true, message: "请选择景区门票", trigger: ["change","blur"] }],
       },
 
       activeName: 'first',
@@ -169,7 +181,7 @@ export default {
       actionUrl: process.env.VUE_APP_BASE_API + process.env.VUE_APP_UPLOAD_IMAGE,
       actionUrlLoading: false,
 
-      jsonObjList: []
+      templateIdList: []
     };
   },
   methods: {
@@ -187,8 +199,8 @@ export default {
           ...row,
           eventTime: [], // 活动时间段
           image: [],
-          useUserRelid_2: [],
-          useUserRelid_3: [],
+          couponVoList: [],
+          performVoList: [],
         })
         this.formStatus = 1
       }else if(model=='EDIT') { // 新增
@@ -204,8 +216,6 @@ export default {
         await this.getTableDeatilsFun(row)
       }
       this.loading = false
-      this.radioInputs(this.form.useType)
-      this.radioInput(this.form.receiveType)
       this.$nextTick(()=>{
         if(this.$refs["form"]) {
           this.$refs["form"].clearValidate();
@@ -223,8 +233,6 @@ export default {
             ...res.data,
             eventTime: [res.data.startDate,res.data.endDate], // 发放时间段
             image: res.data.image?res.data.image.split(','):[],
-            useUserRelid_3: [],
-            useUserRelid_2: []
           }
           this.$set(this,'form',JSON.parse(JSON.stringify(obj)))
           this.formStatus = 1
@@ -250,7 +258,7 @@ export default {
           pageSize: 999
         })
         if(res.code == 200) {
-          this.jsonObjList = res.data.rows;
+          this.templateIdList = res.data.rows;
         }
       } catch (error) {
         this.loading = false
@@ -271,9 +279,12 @@ export default {
           param['startDate'] = param.eventTime[0]
           param['endDate'] = param.eventTime[1]
 
+          param['couponIdList'] = this.form.couponVoList.map((item)=> item.id)
+          param['performIdList'] = this.form.performVoList.map((item)=> item.id)
+
           delete param.eventTime
-          delete param.useUserRelid_2
-          delete param.useUserRelid_3
+          delete param.couponVoList
+          delete param.performVoList
           if (this.model != 'ADD') {
             addTableApi(
               this.configUrl.edit,{
@@ -345,7 +356,7 @@ export default {
       console.log("res, file",response, file, fileList)
       this.actionUrlLoading = false
       if(response.code == 200) {
-        this.form.imag.push(response.data.url)
+        this.form.image.push(response.data.url)
       }
     },
     beforeAvatarUpload(file) {
@@ -368,7 +379,7 @@ export default {
       this.actionUrlLoading = false
     },
     handleRemove(index) {
-      this.form.imag.splice(index,1)
+      this.form.image.splice(index,1)
     },
   },
 };

+ 11 - 11
src/views/tourism/marketingActivities/formBox/templateManagementForm.vue

@@ -2,7 +2,7 @@
   <el-dialog
     :title="title"
     :visible.sync="open"
-    width="70%"
+    width="95%"
     append-to-body
     :close-on-click-modal="false"
     @close="cancel"
@@ -21,10 +21,12 @@
         <el-tabs v-model="activeName" @tab-click="handleClick">
           <el-tab-pane label="模板配置:" name="first"></el-tab-pane>
         </el-tabs>
-        <div style="display: flex;">
-          <div></div>
-          <div>
-            <el-form :model="form" ref="form" :rules="rules" label-width="120px">
+        <div style="display: flex;width: 100%;">
+          <div style="width: calc( 100% - 600px );padding-right: 10px;box-sizing: border-box;">
+            <asEditor />
+          </div>
+          <div style="width: 600px;flex-shrink: 0;border-left: 1px solid #ccc;padding-left: 10px;box-sizing: border-box;">
+            <el-form :model="form" ref="form" :rules="rules" label-width="150px">
               <div>
                   <el-form-item label="模板名称:" prop="activityName">
                     <el-input style="width: 350px;" v-model="form.activityName" placeholder="请输入模板名称" maxlength="50" show-word-limit />
@@ -32,7 +34,7 @@
                   <el-form-item label="页面路径:" prop="activityName">
                     <el-input style="width: 350px;" v-model="form.activityName" placeholder="请输入页面路径" maxlength="50" show-word-limit />
                   </el-form-item>
-                  <el-form-item label="背景图1" prop="image">
+                  <el-form-item label="背景图1" prop="image">
                     <div style="display: flex;">
                       <div 
                       v-for="(item,index) in form.image" 
@@ -75,7 +77,7 @@
                     </div>
                     <span>建议尺寸375px X 392px,支持jpg/png/gif,支持1MB大小以内的图片上传</span>
                   </el-form-item>
-                  <el-form-item label="背景图1" prop="image">
+                  <el-form-item label="背景图2:" prop="image">
                     <div style="display: flex;">
                       <div 
                       v-for="(item,index) in form.image" 
@@ -152,11 +154,11 @@ import {
   addTableApi,
   listTableApi,
  } from '@/api/CURD'
-import selectCouponManagement from '../model/selectCouponManagement.vue'
 import selectTicketOrders from "../model/selectTicketOrders.vue"
+import asEditor from "@/myComponents/asEditor"
 export default {
   name: "addAndEdit",
-  components: {selectCouponManagement,selectTicketOrders},
+  components: {selectTicketOrders,asEditor},
   dicts: ['tourism_couponManagement_type','tourism_couponManagement_useUserType','tourism_couponManagement_receiveType','tourism_couponManagement_useConfig','goods_type'],
   data() {
     return {
@@ -224,8 +226,6 @@ export default {
         await this.getTableDeatilsFun(row)
       }
       this.loading = false
-      this.radioInputs(this.form.useType)
-      this.radioInput(this.form.receiveType)
       this.$nextTick(()=>{
         if(this.$refs["form"]) {
           this.$refs["form"].clearValidate();

+ 5 - 5
src/views/tourism/marketingActivities/templateManagement.vue

@@ -3,11 +3,11 @@
       <el-row :gutter="20">
         <!--用户数据-->
         <el-col :span="24" :xs="24">
-          <el-form v-if="false" :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-            <el-form-item label="活动名称" prop="activityName">
+          <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form-item label="模板名称" prop="name">
               <el-input
-                v-model="queryParams.activityName"
-                placeholder="请输入活动名称"
+                v-model="queryParams.name"
+                placeholder="请输入模板名称"
                 clearable
                 style="width: 240px"
                 @keyup.enter.native="handleQuery"
@@ -92,7 +92,7 @@
     components: {detailsBox,addAndEdit},
     data() {
       return {
-        title: "优惠券管理",// 通用标题
+        title: "模板管理",// 通用标题
         configPermi: {
           add: [''], // 新增权限
           details: ['electronicMembership:memberInformation:details'], // 详情权限

+ 2 - 2
src/views/tourism/membershipManagement/electronicMembership/formBox/membershipLevelForm.vue

@@ -102,8 +102,8 @@
               <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-form-item label="专属优惠:" prop="couponIdList">
+            <el-select v-model="form.couponIdLList" clearable placeholder="请选择专属优惠">
               <el-option
                 v-for="item in scenicAreaProducts"
                 :key="item.value"

+ 2 - 2
src/views/tourism/membershipManagement/electronicMembership/membershipLevel.vue

@@ -49,7 +49,7 @@
                 </template>
             </el-table-column>
             <el-table-column label="享受折扣(%)" align="center" key="discount" prop="discount" v-if="columns[3].visible" :show-overflow-tooltip="true" />
-            <el-table-column label="专属优惠" align="center" key="couponNames" prop="couponNames" v-if="columns[4].visible" :show-overflow-tooltip="true" />
+            <el-table-column label="专属优惠" align="center" key="couponNames" prop="couponNames" v-if="columns[4].visible" :show-overflow-tooltip="true" />
             <el-table-column
               label="操作"
               align="center"
@@ -152,7 +152,7 @@
           { key: 2, label: `积分值`, visible: true },
           { key: 3, label: `等级图片`, visible: true },
           { key: 4, label: `享受折扣`, visible: true },
-          { key: 5, label: `专属优惠`, visible: true },
+          { key: 5, label: `专属优惠`, visible: true },
         ],
       };
     },