This commit is contained in:
DESKTOP-369JRHT\12997 2024-09-09 17:49:44 +08:00
parent c92f9d546f
commit 5f054e7ac2
3 changed files with 124 additions and 46 deletions

View File

@ -80,7 +80,7 @@
<el-table-column label="操作">
<template slot-scope="scope">
<div style="display: flex;">
<el-button type="text" @click="grounding">修改</el-button>
<el-button type="text" @click="updetenCardCoupon(scope.row.id)">修改</el-button>
<el-button type="text" @click="">下架</el-button>
<el-button type="text" @click="remindOpen(scope.row)">删除</el-button>
</div>
@ -177,9 +177,9 @@
<!-- 适用油品油号 oilNumber -->
<el-form-item label="适用油品油号" prop="oilLimit" style="width: 45%;">
<div class="d-s">
<el-radio-group v-model="ruleForm.oilLimit">
<el-radio :label="1">不限</el-radio>
<el-radio :label="2">自定义</el-radio>
<el-radio-group v-model="ruleForm.oilLimit.toString()">
<el-radio :label="'1'">不限</el-radio>
<el-radio :label="'2'">自定义</el-radio>
</el-radio-group>
<el-select v-model="ruleForm.oilNumber" multiple placeholder="请选择" style="margin-left: 5px">
<!-- <el-option v-for="dict in dict.type.oilNumber_type" :key="dict.value" :label="dict.label"-->
@ -193,7 +193,7 @@
<div class="d-s" style="justify-content: space-between">
<el-form-item label="适用会员等级" prop="membershipLevel" style="width: 30%;">
<el-select v-model="ruleForm.membershipLevel" multiple placeholder="请选择">
<el-option v-for="item in membership" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option
v-for="(item,index) in membership"
:label="item.name"
@ -203,9 +203,9 @@
</el-form-item>
<el-form-item label="是否允许收银台送券" label-width="160px" prop="sySend" style="width: 45%;">
<el-radio-group v-model="ruleForm.sySend">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
<el-radio-group v-model="ruleForm.sySend.toString()">
<el-radio :label="'0'"></el-radio>
<el-radio :label="'1'"></el-radio>
</el-radio-group>
@ -216,12 +216,12 @@
<!-- 生效日期设置 timeType 字段 -->
<el-form-item label="生效日期设置" prop="timeType" style="width: 45%;">
<div class="d-s">
<el-radio-group v-model="ruleForm.timeType">
<el-radio :label="1">领取
<el-radio-group v-model="ruleForm.timeType.toString()">
<el-radio :label="'1'">领取
<el-input v-model="ruleForm.validityDay" placeholder=""
style="width: 80px;margin: 0px 10px"></el-input>
<span>天内有效</span></el-radio>
<el-radio :label="2">指定使用日期</el-radio>
<el-radio :label="'2'">指定使用日期</el-radio>
</el-radio-group>
@ -229,8 +229,20 @@
</el-form-item>
<!-- 生效日期 effectiveDateStart 字段 -->
<el-form-item label="生效日期" prop="effectiveDateStart" style="width: 45%;">
<el-date-picker v-model="ruleForm.effectiveDateStart" type="daterange" range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期">
<el-date-picker
v-model="ruleForm.effectiveDateStart"
style="width: 160px"
type="date"
value-format="yyyy-MM-dd"
placeholder="开始日期">
</el-date-picker>
<span style="margin: 0 5px"></span>
<el-date-picker
v-model="ruleForm.effectiveDateEnd"
style="width: 160px"
type="date"
value-format="yyyy-MM-dd"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
</div>
@ -238,9 +250,9 @@
<div class="d-s" style="justify-content: space-between">
<el-form-item label="是否与其他优惠同时使用" label-width="180px" prop="useWithOther" style="width: 45%;">
<el-radio-group v-model="ruleForm.useWithOther">
<el-radio :label="0">不可以</el-radio>
<el-radio :label="1">可以</el-radio>
<el-radio-group v-model="ruleForm.useWithOther.toString()">
<el-radio :label="'0'">不可以</el-radio>
<el-radio :label="'1'">可以</el-radio>
</el-radio-group>
@ -262,14 +274,14 @@
</div>
<div class="d-s" style="justify-content: space-between">
<el-form-item label="适用时间段" style="width: 45%;">
<el-radio-group v-model="ruleForm.availableType">
<el-radio :label="1" style="margin-bottom: 15px">每周
<el-radio-group v-model="ruleForm.availableType.toString()">
<el-radio :label="'1'" style="margin-bottom: 15px">每周
<el-select v-model="ruleForm.availableWeek" multiple placeholder="请选择周日期">
<el-option v-for="item in weekList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-radio>
<el-radio :label="2" style="margin-bottom: 15px">每月
<el-radio :label="'2'" style="margin-bottom: 15px">每月
<el-select v-model="ruleForm.availableDay" multiple placeholder="请选择每月固定日期">
<el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
@ -304,14 +316,14 @@
</el-form-item>
<el-form-item label="不适用时间段" style="width: 45%;">
<el-radio-group v-model="ruleForm.unAvailableType">
<el-radio :label="1" style="margin-bottom: 15px">每周
<el-radio-group v-model="ruleForm.unAvailableType.toString()">
<el-radio :label="'1'" style="margin-bottom: 15px">每周
<el-select v-model="ruleForm.unAvailableWeek" multiple placeholder="请选择周日期">
<el-option v-for="item in weekList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-radio>
<el-radio :label="2" style="margin-bottom: 15px">每月
<el-radio :label="'2'" style="margin-bottom: 15px">每月
<el-select v-model="ruleForm.unAvailableDay" multiple placeholder="请选择每月固定日期">
<el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
@ -405,7 +417,7 @@ import imgUpload from "@/components/ImageUpload/index.vue"
import {getToken} from "@/utils/auth";
import imgUpload1 from "@/components/map/imgUpload.vue";
import {Row} from "element-ui";
import {addCardCoupon, listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {addCardCoupon, listCardCoupon,getCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getOilNameList, oilNumberList} from "@/api/order/oilnumgun";
import {listUserGrade} from "@/api/staff/user/usergrade";
@ -638,6 +650,12 @@ export default {
oilNumberList:[],
oilNameList:[],
ruleForm: {
oilLimit:'1',
sySend:'0',
timeType:'1',
useWithOther:'0',
availableType:'1',
unAvailableType:'1',
name: '',
number: '',
status: '',
@ -660,22 +678,7 @@ export default {
},
membership: [
{
label: "普通会员",
value: '0'
},
{
label: "白金会员",
value: '1'
},
{
label: "黄金会员",
value: '2'
},
{
label: "钻石会员",
value: '3'
}
],
rules: {
name: [
@ -693,7 +696,7 @@ export default {
},
created() {
this.getOilList()
this.listUserGrade()
},
components: {
imgUpload1,
@ -742,9 +745,61 @@ export default {
TypeindexOther(index) {
this.useWithOther = index;
},
updetenCardCoupon(id) {
this.centerDialogVisible = !this.centerDialogVisible
getCardCoupon(id).then(res => {
this.ruleForm = res.data
if( res.data.unAvailableWeek){
this.ruleForm.unAvailableWeek = res.data.unAvailableWeek.split(",")
}
if(res.data.unAvailableDay){
this.ruleForm.unAvailableDay = res.data.unAvailableDay.split(",")
}
if( res.data.availableWeek){
this.ruleForm.availableWeek = res.data.availableWeek.split(",")
}
if(res.data.availableDay){
this.ruleForm.availableDay = res.data.availableDay.split(",")
}
if(res.data.membershipLevel){
this.ruleForm.membershipLevel = res.data.membershipLevel.split(",")
}
if(res.data.oilNumber){
this.ruleForm.oilNumber = res.data.oilNumber.split(",")
}
})
},
addCertificate() {
this.ruleForm = {
oilLimit:1,
sySend:0,
timeType:1,
useWithOther:0,
availableType:1,
unAvailableType:1,
name: '',
number: '',
quantity: '',
cardAmount: '',
remark: '',
putType: '',
oilNumber: '',
region: '',
membershipLevel: '',
limitTotalDay: '',
ruleForm: '',
tfTotal: 0,
dayGetLimit: 0,
getNumLimit: 0,
useCondition: "",
validityDay: 30
},
this.centerDialogVisible = !this.centerDialogVisible
//
this.listUserGrade()
},
getwysk(row) {
if (row.sailStatus == 1) {
@ -927,15 +982,30 @@ export default {
}
},
addBlock() {
if (this.ruleForm.quantity == '' || this.ruleForm.cardAmount == '' || this.ruleForm.status == '') {
this.$message.error('必填项不能有空')
return
if( this.ruleForm.unAvailableWeek){
this.ruleForm.unAvailableWeek = this.ruleForm.unAvailableWeek.toString()
}
let data = this.ruleForm
console.log(data);
if(this.ruleForm.unAvailableDay){
this.ruleForm.unAvailableDay = this.ruleForm.unAvailableDay.toString()
}
if( this.ruleForm.availableWeek){
this.ruleForm.availableWeek = this.ruleForm.availableWeek.toString()
}
if(this.ruleForm.availableDay){
this.ruleForm.availableDay = this.ruleForm.availableDay.toString()
}
if(this.ruleForm.membershipLevel){
this.ruleForm.membershipLevel = this.ruleForm.membershipLevel.toString()
}
if(this.ruleForm.oilNumber){
this.ruleForm.oilNumber = this.ruleForm.oilNumber.toString()
}
// addList(data).then(res => {
addCardCoupon(data).then(res => {
addCardCoupon(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message.success('添加成功');
this.gettj()

View File

@ -79,6 +79,8 @@ public class CardCouponController extends BaseController {
if (count>0){
return getFailureResult("编号已存在");
}
cardCoupon.setStoreId(nowAccountInfo.getStoreId());
cardCoupon.setChainStorId(nowAccountInfo.getChainStoreId());
return getSuccessResult(this.cardCouponService.save(cardCoupon));
}

View File

@ -2,8 +2,12 @@ package com.fuint.business.marketingActivity.cardCoupon.entity;
import java.time.LocalTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@ -18,6 +22,8 @@ import java.io.Serializable;
@Data
public class CardCoupon extends Model<CardCoupon> {
//主键id
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
//所属连锁店id
private Integer chainStorId;