|
|
@@ -221,7 +221,7 @@
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
|
- <!-- 添加优惠券 -->
|
|
|
+ <!-- 查看优惠券日志 -->
|
|
|
<el-dialog
|
|
|
title="查看优惠券日志"
|
|
|
custom-class="couponLog"
|
|
|
@@ -273,177 +273,328 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 添加优惠券 -->
|
|
|
- <el-dialog title="添加优惠券" :visible.sync="dialogFormVisible" center>
|
|
|
- <div style="margin-bottom: 10px;" v-if="this.shopId == -1">
|
|
|
- <span style="width: 200px;display: inline-block;text-align: right;"
|
|
|
- >商铺名称:</span
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="shopNames"
|
|
|
- placeholder="请选择商铺"
|
|
|
- style="width:50%;"
|
|
|
- @focus="selectUserId"
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 10px;">
|
|
|
- <span style="width: 200px;display: inline-block;text-align: right;"
|
|
|
- >优惠券名称:</span
|
|
|
- >
|
|
|
- <el-input
|
|
|
- style="width:50%;"
|
|
|
- v-model="couponName"
|
|
|
- type="text"
|
|
|
- placeholder="请输入优惠券名称"
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 10px;">
|
|
|
- <span style="width: 200px;display: inline-block;text-align: right;"
|
|
|
- >图片:</span
|
|
|
- >
|
|
|
- <!-- <el-input style="width:50%;" v-model="couponPicture" type="text" placeholder="请输入图片"></el-input> -->
|
|
|
- <div
|
|
|
- style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;"
|
|
|
- >
|
|
|
- <el-upload
|
|
|
- class="avatar-uploader"
|
|
|
- v-model="couponPicture"
|
|
|
- :action="Tupiantou"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="handleAvatarSuccess1"
|
|
|
- :before-upload="beforeAvatarUpload"
|
|
|
+ <el-dialog
|
|
|
+ customClass="discount"
|
|
|
+ title="添加优惠券"
|
|
|
+ :visible.sync="dialogFormVisible"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <div style="display: flex;justify-content: center;">
|
|
|
+ <div>
|
|
|
+ <div style="margin-bottom: 10px;" v-if="this.shopId == -1">
|
|
|
+ <span style="width:150px;display: inline-block;text-align: right;"
|
|
|
+ >商铺名称:</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="shopNames"
|
|
|
+ placeholder="请选择商铺"
|
|
|
+ style="width:50%;"
|
|
|
+ @focus="selectUserId"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span style="width: 150px;display: inline-block;text-align: right;"
|
|
|
+ >优惠券名称:</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ style="width:50%;"
|
|
|
+ v-model="couponName"
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入优惠券名称"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span style="width: 150px;display: inline-block;text-align: right;"
|
|
|
+ >图片:</span
|
|
|
+ >
|
|
|
+ <!-- <el-input style="width:50%;" v-model="couponPicture" type="text" placeholder="请输入图片"></el-input> -->
|
|
|
+ <div
|
|
|
+ style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;"
|
|
|
+ >
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ v-model="couponPicture"
|
|
|
+ :action="Tupiantou"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="handleAvatarSuccess1"
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ v-if="couponPicture"
|
|
|
+ :src="couponPicture"
|
|
|
+ class="avatar"
|
|
|
+ style="width: 148px;height: 148px;"
|
|
|
+ />
|
|
|
+ <i
|
|
|
+ v-else
|
|
|
+ class="el-icon-plus avatar-uploader-icon"
|
|
|
+ style="font-size: 28px;color: #8c939d"
|
|
|
+ ></i>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span style="width: 150px;display: inline-block;text-align: right;"
|
|
|
+ >优惠券金额:</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ style="width:50%;"
|
|
|
+ v-model="money"
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入优惠券金额"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span style="width: 150px;display: inline-block;text-align: right;"
|
|
|
+ >最低消费:</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ style="width:50%;"
|
|
|
+ v-model="minMoney"
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入最低消费"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span style="width: 150px;display: inline-block;text-align: right;"
|
|
|
+ >有效天数:</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ style="width:50%;"
|
|
|
+ v-model="endDate"
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入有效天数"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom: 10px;" v-if="this.shopId == 0">
|
|
|
+ <span style="width: 150px;display: inline-block;text-align: right;"
|
|
|
+ >兑换积分:</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ style="width:50%;"
|
|
|
+ v-model="needIntegral"
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入兑换积分"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <span style="color: red;margin-left: 32px;"
|
|
|
+ >兑换积分初始值为100,是必填项,不填则默认向所有用户发券</span
|
|
|
>
|
|
|
- <img
|
|
|
- v-if="couponPicture"
|
|
|
- :src="couponPicture"
|
|
|
- class="avatar"
|
|
|
- style="width: 148px;height: 148px;"
|
|
|
- />
|
|
|
- <i
|
|
|
- v-else
|
|
|
- class="el-icon-plus avatar-uploader-icon"
|
|
|
- style="font-size: 28px;color: #8c939d"
|
|
|
- ></i>
|
|
|
- </el-upload>
|
|
|
+ </div>
|
|
|
+ <div v-loading="allShopLoading" v-if="this.shopId == 0">
|
|
|
+ <div style="width: 500px;height: 200px;">
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span
|
|
|
+ style="width: 150px;display: inline-block;text-align: right;"
|
|
|
+ >使用范围:</span
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ @change="checkChange($event, '不限制')"
|
|
|
+ v-model="allMerchant"
|
|
|
+ >不限制</el-checkbox
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ @change="checkChange($event, '部分商家')"
|
|
|
+ v-model="someMerchant"
|
|
|
+ >部分商家</el-checkbox
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div style="margin:0 0 10px 80px;" v-if="someMerchant">
|
|
|
+ <el-input
|
|
|
+ v-model="selectName"
|
|
|
+ placeholder="请输入商铺名称"
|
|
|
+ style="width:50%;"
|
|
|
+ clearable
|
|
|
+ @change="shopNameSeache"
|
|
|
+ ></el-input>
|
|
|
+ <!-- <el-button
|
|
|
+ style="margin-left: 15px"
|
|
|
+ size="medium"
|
|
|
+ type="primary"
|
|
|
+ icon="document"
|
|
|
+ @click="shopNameSeache"
|
|
|
+ >查询
|
|
|
+ </el-button> -->
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="someMerchant"
|
|
|
+ style="margin:0 0 10px 80px;height: 300px;border: 1px solid #ccc;overflow: auto;"
|
|
|
+ @scroll="handleTreeScroll"
|
|
|
+ >
|
|
|
+ <el-tree
|
|
|
+ class="shop"
|
|
|
+ ref="tree"
|
|
|
+ :data="dataTree"
|
|
|
+ show-checkbox
|
|
|
+ node-key="shopId"
|
|
|
+ :props="defaultProps"
|
|
|
+ @check="treeCheck"
|
|
|
+ ></el-tree>
|
|
|
+ <div style="text-align: center;" v-if="allShopListShow">
|
|
|
+ 数据已全部加载完
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom: 10px;" v-if="someMerchant">
|
|
|
+ <span
|
|
|
+ style="width: 130px;display: inline-block;text-align: right;"
|
|
|
+ >已选择</span
|
|
|
+ ><span style="color: red;">{{ selectMerchant.length }}</span
|
|
|
+ >个商家
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="margin-bottom: 10px;">
|
|
|
- <span style="width: 200px;display: inline-block;text-align: right;"
|
|
|
- >优惠券金额:</span
|
|
|
- >
|
|
|
- <el-input
|
|
|
- style="width:50%;"
|
|
|
- v-model="money"
|
|
|
- type="text"
|
|
|
- placeholder="请输入优惠券金额"
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 10px;">
|
|
|
- <span style="width: 200px;display: inline-block;text-align: right;"
|
|
|
- >最低消费:</span
|
|
|
- >
|
|
|
- <el-input
|
|
|
- style="width:50%;"
|
|
|
- v-model="minMoney"
|
|
|
- type="text"
|
|
|
- placeholder="请输入最低消费"
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 10px;">
|
|
|
- <span style="width: 200px;display: inline-block;text-align: right;"
|
|
|
- >有效天数:</span
|
|
|
- >
|
|
|
- <el-input
|
|
|
- style="width:50%;"
|
|
|
- v-model="endDate"
|
|
|
- type="text"
|
|
|
- placeholder="请输入有效天数"
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 10px;" v-if="this.shopId == 0">
|
|
|
- <span style="width: 200px;display: inline-block;text-align: right;"
|
|
|
- >兑换积分:</span
|
|
|
- >
|
|
|
- <el-input
|
|
|
- style="width:50%;"
|
|
|
- v-model="needIntegral"
|
|
|
- type="text"
|
|
|
- placeholder="请输入兑换积分"
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- <span style="color: red;margin-left: 142px;"
|
|
|
- >兑换积分初始值为100,是必填项,不填则默认向所有用户发券</span
|
|
|
- >
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="StairNoticeTo()">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 修改优惠券 -->
|
|
|
- <el-dialog title="修改优惠券" :visible.sync="dialogFormVisible1" center>
|
|
|
- <el-form :model="form">
|
|
|
- <el-form-item
|
|
|
- label="商铺名称:"
|
|
|
- :label-width="formLabelWidth"
|
|
|
- v-if="this.shopId == -1"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="shopNames"
|
|
|
- placeholder="请选择商铺"
|
|
|
- style="width:50%;"
|
|
|
- @focus="selectUserId"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="优惠券名称:" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.couponName" style="width:65%;"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="图片:" :label-width="formLabelWidth">
|
|
|
- <!-- <el-input v-model="form.campusDetails" style="width:65%;"></el-input> -->
|
|
|
- <div
|
|
|
- style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;"
|
|
|
- >
|
|
|
- <el-upload
|
|
|
- class="avatar-uploader"
|
|
|
- v-model="form.couponPicture"
|
|
|
- :action="Tupiantou"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="handleAvatarSuccess2"
|
|
|
- :before-upload="beforeAvatarUpload"
|
|
|
- >
|
|
|
- <img
|
|
|
- v-if="form.couponPicture"
|
|
|
- :src="form.couponPicture"
|
|
|
- class="avatar"
|
|
|
- style="width: 148px;height: 148px;"
|
|
|
- />
|
|
|
- <i
|
|
|
- v-else
|
|
|
- class="el-icon-plus avatar-uploader-icon"
|
|
|
- style="font-size: 28px;color: #8c939d"
|
|
|
- ></i>
|
|
|
- </el-upload>
|
|
|
+ <el-dialog
|
|
|
+ customClass="discount"
|
|
|
+ title="修改优惠券"
|
|
|
+ :visible.sync="dialogFormVisible1"
|
|
|
+ center
|
|
|
+ :before-close="compileClose"
|
|
|
+ >
|
|
|
+ <div style="display: flex;justify-content: center;">
|
|
|
+ <el-form :model="form">
|
|
|
+ <div style="display: flex;justify-content: center;">
|
|
|
+ <div>
|
|
|
+ <el-form-item
|
|
|
+ label="商铺名称:"
|
|
|
+ :label-width="formLabelWidth"
|
|
|
+ v-if="this.shopId == -1"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="shopNames"
|
|
|
+ placeholder="请选择商铺"
|
|
|
+ style="width:50%;"
|
|
|
+ @focus="selectUserId"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="优惠券名称:" :label-width="formLabelWidth">
|
|
|
+ <el-input
|
|
|
+ v-model="form.couponName"
|
|
|
+ style="width:65%;"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图片:" :label-width="formLabelWidth">
|
|
|
+ <!-- <el-input v-model="form.campusDetails" style="width:65%;"></el-input> -->
|
|
|
+ <div
|
|
|
+ style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;display: inline-block;"
|
|
|
+ >
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ v-model="form.couponPicture"
|
|
|
+ :action="Tupiantou"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="handleAvatarSuccess2"
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ v-if="form.couponPicture"
|
|
|
+ :src="form.couponPicture"
|
|
|
+ class="avatar"
|
|
|
+ style="width: 148px;height: 148px;"
|
|
|
+ />
|
|
|
+ <i
|
|
|
+ v-else
|
|
|
+ class="el-icon-plus avatar-uploader-icon"
|
|
|
+ style="font-size: 28px;color: #8c939d"
|
|
|
+ ></i>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="优惠券金额:" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="form.money" style="width:65%;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最低消费:" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="form.minMoney" style="width:65%;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="有效天数:" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="form.endDate" style="width:65%;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="兑换积分:"
|
|
|
+ :label-width="formLabelWidth"
|
|
|
+ v-if="this.shopId == 0"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="form.needIntegral"
|
|
|
+ style="width:65%;"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <span style="color: red;margin-left: 32px;"
|
|
|
+ >兑换积分初始值为100,是必填项,不填则默认向所有用户发券</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div v-loading="allShopLoading" v-if="this.shopId == 0">
|
|
|
+ <div style="width: 500px;height: 200px;">
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <span
|
|
|
+ style="width: 150px;display: inline-block;text-align: right;"
|
|
|
+ >使用范围:</span
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ @change="checkChange($event, '不限制')"
|
|
|
+ v-model="allMerchant"
|
|
|
+ >不限制</el-checkbox
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ @change="checkChange($event, '部分商家')"
|
|
|
+ v-model="someMerchant"
|
|
|
+ >部分商家</el-checkbox
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div style="margin:0 0 10px 80px;" v-if="someMerchant">
|
|
|
+ <el-input
|
|
|
+ v-model="selectName"
|
|
|
+ placeholder="请输入商铺名称"
|
|
|
+ style="width:50%;"
|
|
|
+ clearable
|
|
|
+ @change="shopNameSeache"
|
|
|
+ ></el-input>
|
|
|
+ <!-- <el-button
|
|
|
+ style="margin-left: 15px"
|
|
|
+ size="medium"
|
|
|
+ type="primary"
|
|
|
+ icon="document"
|
|
|
+ @click="shopNameSeache"
|
|
|
+ >查询
|
|
|
+ </el-button> -->
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="someMerchant"
|
|
|
+ style="margin:0 0 10px 80px;height: 300px;border: 1px solid #ccc;overflow: auto;"
|
|
|
+ @scroll="handleTreeScroll"
|
|
|
+ >
|
|
|
+ <el-tree
|
|
|
+ class="shop"
|
|
|
+ ref="tree"
|
|
|
+ :data="dataTree"
|
|
|
+ show-checkbox
|
|
|
+ node-key="shopId"
|
|
|
+ :props="defaultProps"
|
|
|
+ @check="treeCheck"
|
|
|
+ ></el-tree>
|
|
|
+ <div style="text-align: center;" v-if="allShopListShow">
|
|
|
+ 数据已全部加载完
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-bottom: 10px;" v-if="someMerchant">
|
|
|
+ <span
|
|
|
+ style="width: 130px;display: inline-block;text-align: right;"
|
|
|
+ >已选择</span
|
|
|
+ ><span style="color: red;">{{ selectMerchant.length }}</span
|
|
|
+ >个商家
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="优惠券金额:" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.money" style="width:65%;"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="最低消费:" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.minMoney" style="width:65%;"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="有效天数:" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="form.endDate" style="width:65%;"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="兑换积分:"
|
|
|
- :label-width="formLabelWidth"
|
|
|
- v-if="this.shopId == 0"
|
|
|
- >
|
|
|
- <el-input v-model="form.needIntegral" style="width:65%;"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <span style="color: red;margin-left: 120px;"
|
|
|
- >兑换积分初始值为100,是必填项,不填则默认向所有用户发券</span
|
|
|
- >
|
|
|
- </el-form>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="CompileNoticeTo()">确 定</el-button>
|
|
|
@@ -740,6 +891,26 @@ export default {
|
|
|
minMoney: "",
|
|
|
money: "",
|
|
|
needIntegral: "100",
|
|
|
+
|
|
|
+ // 使用范围
|
|
|
+ allMerchant: false,
|
|
|
+ someMerchant: false,
|
|
|
+ dataTree: [],
|
|
|
+ defaultProps: {
|
|
|
+ label: "shopName",
|
|
|
+ value: "shopId"
|
|
|
+ },
|
|
|
+ merchantPage: 1,
|
|
|
+ merchantLimit: 20,
|
|
|
+ selectName: "",
|
|
|
+ allShopListShow: false, // 商家下拉全部加载完成
|
|
|
+ allShopLoading: true, // 商家下拉数据加载中
|
|
|
+ merchantList: [],
|
|
|
+ usedShopId: "",
|
|
|
+ selectMerchant: [], // 勾选中的数据
|
|
|
+ merchantTotalPage: 1,
|
|
|
+ merchantSelectTotal: "",
|
|
|
+
|
|
|
form: {
|
|
|
couponId: "",
|
|
|
couponName: "",
|
|
|
@@ -874,15 +1045,33 @@ export default {
|
|
|
this.money = "";
|
|
|
this.needIntegral = "100";
|
|
|
this.shopNames = "";
|
|
|
+
|
|
|
+ this.merchantPage = 1;
|
|
|
+ this.merchantList = [];
|
|
|
+ this.selectMerchant = [];
|
|
|
+ this.allMerchant = false;
|
|
|
+ this.someMerchant = false;
|
|
|
+ this.allShopListShow = false;
|
|
|
+
|
|
|
if (this.shopId === 0) {
|
|
|
this.shopIds = 0;
|
|
|
+ this.merchantData();
|
|
|
} else {
|
|
|
this.shopIds = "";
|
|
|
}
|
|
|
|
|
|
+ // 重置滚动位置
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // console.log(document.querySelector('.shop'));
|
|
|
+ // // document.querySelector('.el-tree__body-wrapper')
|
|
|
+ // const treeWrapper = this.$refs.tree;
|
|
|
+ // if (treeWrapper) {
|
|
|
+ // treeWrapper.scrollTop = 0; // 重置滚动位置
|
|
|
+ // }
|
|
|
+ // });
|
|
|
this.dialogFormVisible = true;
|
|
|
},
|
|
|
- // 添加优惠券
|
|
|
+ // 确定添加优惠券
|
|
|
StairNoticeTo() {
|
|
|
if (this.couponName == "") {
|
|
|
this.$notify({
|
|
|
@@ -930,7 +1119,26 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (this.shopId == 0) {
|
|
|
+ if (!this.allMerchant && !this.someMerchant) {
|
|
|
+ this.$notify({
|
|
|
+ title: "提示",
|
|
|
+ duration: 1800,
|
|
|
+ message: "商家不能为空",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (this.shopId === 0) {
|
|
|
+ this.usedShopId = "";
|
|
|
+ if (this.allMerchant) {
|
|
|
+ this.usedShopId = 0;
|
|
|
+ }
|
|
|
+ if (this.someMerchant) {
|
|
|
+ this.usedShopId = this.selectMerchant.join(",");
|
|
|
+ }
|
|
|
if (this.needIntegral == "") {
|
|
|
this.$notify({
|
|
|
title: "提示",
|
|
|
@@ -940,8 +1148,9 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ this.usedShopId = "";
|
|
|
}
|
|
|
-
|
|
|
this.$http({
|
|
|
url: this.$http.adornUrl("admin/coupon/issueCoupon"),
|
|
|
method: "post",
|
|
|
@@ -953,7 +1162,8 @@ export default {
|
|
|
money: this.money,
|
|
|
needIntegral: this.needIntegral,
|
|
|
shopId: this.shopIds,
|
|
|
- sysUserId: this.userId
|
|
|
+ sysUserId: this.userId,
|
|
|
+ usedShopId: this.usedShopId
|
|
|
})
|
|
|
}).then(({ data }) => {
|
|
|
if (data.code == 0) {
|
|
|
@@ -976,8 +1186,107 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ checkChange(val, title) {
|
|
|
+ console.log(val, title);
|
|
|
+ if (val) {
|
|
|
+ if (title == "不限制") {
|
|
|
+ this.someMerchant = false;
|
|
|
+ }
|
|
|
+ if (title == "部分商家") {
|
|
|
+ this.allMerchant = false;
|
|
|
+ // this.merchantData();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.tree) {
|
|
|
+ this.$refs.tree.setCheckedKeys(this.selectMerchant);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ treeCheck(checkedNodes, checkedKeys) {
|
|
|
+ console.log(checkedKeys.checkedKeys);
|
|
|
+ this.selectMerchant = checkedKeys.checkedKeys;
|
|
|
+ },
|
|
|
+ // 平台优惠券 弹窗 搜索商铺
|
|
|
+ shopNameSeache() {
|
|
|
+ this.merchantPage = 1;
|
|
|
+ this.merchantData();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 商铺列表
|
|
|
+ merchantData(title) {
|
|
|
+ this.allShopLoading = true;
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl("admin/goods/selectAllShop"),
|
|
|
+ method: "get",
|
|
|
+ params: this.$http.adornParams({
|
|
|
+ page: this.merchantPage,
|
|
|
+ limit: this.merchantLimit,
|
|
|
+ shopName: this.selectName
|
|
|
+ })
|
|
|
+ }).then(({ data }) => {
|
|
|
+ console.log(data, "店铺名称列表");
|
|
|
+ if (data.code == 0) {
|
|
|
+ if (title == "滚动") {
|
|
|
+ this.dataTree = [...this.dataTree, ...data.data.list];
|
|
|
+ } else {
|
|
|
+ this.dataTree = data.data.list;
|
|
|
+ }
|
|
|
+ console.log(this.selectMerchant, "选择的数据");
|
|
|
+ if (this.$refs.tree) {
|
|
|
+ this.$refs.tree.setCheckedKeys(this.selectMerchant);
|
|
|
+ }
|
|
|
+ this.merchantTotalPage = data.data.totalPage;
|
|
|
+ this.allShopLoading = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 树形组件滚动操作
|
|
|
+ handleTreeScroll(event) {
|
|
|
+ const { scrollTop, scrollHeight, clientHeight } = event.target;
|
|
|
+ // 判断是否滚动到底部
|
|
|
+ if (scrollTop + clientHeight >= scrollHeight) {
|
|
|
+ console.log("滚动到底部了");
|
|
|
+ // 在这里执行你需要的逻辑,比如加载更多数据
|
|
|
+ if (this.merchantPage >= this.merchantTotalPage) {
|
|
|
+ // this.$message({
|
|
|
+ // title: "提示",
|
|
|
+ // duration: 1800,
|
|
|
+ // message: "数据已全部加载完",
|
|
|
+ // type: "warning"
|
|
|
+ // });
|
|
|
+ this.allShopListShow = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.merchantPage++;
|
|
|
+ console.log(this.merchantPage, "后");
|
|
|
+
|
|
|
+ this.merchantData("滚动");
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 修改优惠券
|
|
|
compile(index, rows) {
|
|
|
+ this.selectMerchant = [];
|
|
|
+ console.log(rows);
|
|
|
+ this.merchantPage = 1;
|
|
|
+ this.merchantData();
|
|
|
+ if (rows.usedShopId == 0) {
|
|
|
+ this.usedShopId = 0;
|
|
|
+ this.allMerchant = true;
|
|
|
+ this.someMerchant = false;
|
|
|
+ } else if (rows.usedShopId != null && rows.usedShopId != 0) {
|
|
|
+ this.usedShopId = rows.usedShopId;
|
|
|
+ this.selectMerchant = rows.usedShopId.split(",");
|
|
|
+ this.allMerchant = false;
|
|
|
+ this.someMerchant = true;
|
|
|
+ } else {
|
|
|
+ this.usedShopId = "";
|
|
|
+ this.allMerchant = false;
|
|
|
+ this.someMerchant = false;
|
|
|
+ }
|
|
|
+ this.allShopListShow = false;
|
|
|
+
|
|
|
this.form.couponName = rows.couponName;
|
|
|
this.form.couponPicture = rows.couponPicture;
|
|
|
this.form.endDate = rows.endDate;
|
|
|
@@ -989,7 +1298,20 @@ export default {
|
|
|
this.shopIds = rows.shopId;
|
|
|
this.dialogFormVisible1 = true;
|
|
|
},
|
|
|
- // 修改优惠券
|
|
|
+ compileClose() {
|
|
|
+ if (this.shopId == 0 && this.someMerchant) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const treeWrapper = this.$refs.tree.$el.querySelector(".el-tree");
|
|
|
+ if (treeWrapper) {
|
|
|
+ treeWrapper.scrollTop = 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.dialogFormVisible1 = false;
|
|
|
+ this.allMerchant = false;
|
|
|
+ this.someMerchant = false;
|
|
|
+ },
|
|
|
+ // 确定修改优惠券
|
|
|
CompileNoticeTo() {
|
|
|
if (this.form.campusName == "") {
|
|
|
this.$notify({
|
|
|
@@ -1036,9 +1358,27 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.shopId == 0) {
|
|
|
+ if (!this.allMerchant && !this.someMerchant) {
|
|
|
+ this.$notify({
|
|
|
+ title: "提示",
|
|
|
+ duration: 1800,
|
|
|
+ message: "商家不能为空",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (this.shopId === 0) {
|
|
|
- if (this.form.needIntegral == "") {
|
|
|
+ this.usedShopId = "";
|
|
|
+ if (this.allMerchant) {
|
|
|
+ this.usedShopId = 0;
|
|
|
+ }
|
|
|
+ if (this.someMerchant) {
|
|
|
+ this.usedShopId = this.selectMerchant.join(",");
|
|
|
+ }
|
|
|
+ if (this.needIntegral == "") {
|
|
|
this.$notify({
|
|
|
title: "提示",
|
|
|
duration: 1800,
|
|
|
@@ -1047,6 +1387,8 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ this.usedShopId = "";
|
|
|
}
|
|
|
this.$http({
|
|
|
url: this.$http.adornUrl("admin/coupon/updateCoupon"),
|
|
|
@@ -1060,7 +1402,8 @@ export default {
|
|
|
money: this.form.money,
|
|
|
needIntegral: this.form.needIntegral,
|
|
|
shopId: this.shopIds,
|
|
|
- sysUserId: this.userId
|
|
|
+ sysUserId: this.userId,
|
|
|
+ usedShopId: this.usedShopId
|
|
|
})
|
|
|
}).then(({ data }) => {
|
|
|
if (data.code == 0) {
|
|
|
@@ -1477,4 +1820,14 @@ export default {
|
|
|
.couponLog {
|
|
|
width: 60%;
|
|
|
}
|
|
|
+.discount {
|
|
|
+ width: 1000px;
|
|
|
+ .shop {
|
|
|
+ .el-tree-node__content {
|
|
|
+ .is-leaf.el-tree-node__expand-icon {
|
|
|
+ // display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|