适用商品

This commit is contained in:
PQZ 2024-09-26 17:13:51 +08:00
parent c274a7f9e1
commit 1c6df767a5
5 changed files with 48 additions and 6 deletions

View File

@ -11,7 +11,7 @@ VUE_APP_BASE_API = '/dev-api'
VUE_APP_PUBLIC_PATH = '/'
# 后端接口地址
VUE_APP_SERVER_URL = 'http://192.168.31.95:8080/'
VUE_APP_SERVER_URL = 'http://127.0.0.1:8080/'
# http://192.168.0.121:8080/

View File

@ -270,6 +270,22 @@
</div>
</el-form-item>
<el-form-item v-if="ruleForm.type == '5'" label="适用商品" prop="productLimit" style="width: 50%;">
<el-radio v-model="ruleForm.productLimit" label="1">不限</el-radio>
<el-radio v-model="ruleForm.productLimit" label="2">自定义</el-radio>
<el-select multiple v-if="ruleForm.productLimit == 2" v-model="ruleForm.productIdList" placeholder="请选择商品名称(可多选)" style="margin-left: 10px;width:300px">
<el-option
v-for="item in goodsList"
:key="item.id+''"
:label="item.name"
:value="item.id+''"></el-option>
</el-select>
<!-- </div>-->
<!-- </div>-->
</el-form-item>
<!-- 生效日期 effectiveDateStart 字段 -->
<el-form-item label="生效日期" required style="width: 50%;" v-if="ruleForm.timeType=='2'">
<el-date-picker
@ -459,6 +475,7 @@ import {
getqb,
getsk
} from "@/api/EventMarketing/giftBlock";
import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
import imgUpload from "@/components/ImageUpload/index.vue"
import {getToken} from "@/utils/auth";
import imgUpload1 from "@/components/map/imgUpload.vue";
@ -505,6 +522,7 @@ export default {
onelist: [],
twolist: [],
threelist: [],
goodsList: [],
orderShow: false,
weekList: [
{
@ -703,6 +721,9 @@ export default {
oilNumberList: [],
oilNameList: [],
ruleForm: {
productIdList:[],
productIds:'',
productLimit:1,
oilLimit: '',
sySend: '',
timeType: '',
@ -746,6 +767,7 @@ export default {
this.getOilList()
this.getlist()
this.gettj()
this.getGoodsList()
},
components: {
@ -753,6 +775,11 @@ export default {
imgUpload,
},
methods: {
getGoodsList(){
listLJGoods({page:1,pageSize:10000,status:'qy',isRecovery:0}).then(response => {
this.goodsList = response.data.records;
});
},
sxCoupon(id) {
getCoupon(id).then(res => {
if (res.code == 200) {
@ -925,6 +952,7 @@ export default {
pageNo: 1,
pageSize: 10
}
this.goodsList = [];
this.getlist();
},
getlist() {
@ -1062,8 +1090,8 @@ export default {
if (this.ruleForm.oilNumber) {
this.ruleForm.oilNumber = this.ruleForm.oilNumber.toString()
}
let productIds = this.ruleForm.productIdList + ''
this.ruleForm.productIds = productIds
if (!this.ruleForm.id) {
addCardCoupon(this.ruleForm).then(res => {
@ -1071,6 +1099,7 @@ export default {
this.$message.success('添加成功');
this.gettj()
this.getlist()
this.centerDialogVisible = false
} else {
this.$message.error('操作失败请稍后再试');
}
@ -1083,6 +1112,7 @@ export default {
this.$message.success('修改成功');
this.gettj()
this.getlist()
this.centerDialogVisible = false
} else {
this.$message.error('操作失败请稍后再试');
}
@ -1092,7 +1122,6 @@ export default {
}
this.centerDialogVisible = false
}
}
}

View File

@ -10,6 +10,7 @@ import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService;
import com.fuint.business.marketingActivity.cardGiftActive.entity.CardGiftActive;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
/**
@ -59,7 +61,14 @@ public class CardCouponController extends BaseController {
*/
@GetMapping("{id}")
public ResponseObject selectOne(@PathVariable Serializable id) {
return getSuccessResult(this.cardCouponService.getById(id));
CardCoupon cardCoupon = cardCouponService.getById(id);
if (StringUtils.isNotEmpty(cardCoupon.getProductIds())){
String[] array = cardCoupon.getProductIds().split(",");
// 转换为列表
List<String> list = Arrays.asList(array);
cardCoupon.setProductIdList(list);
}
return getSuccessResult(cardCoupon);
}
/**

View File

@ -13,6 +13,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.List;
/**
* 油站优惠卷表2024(CardCoupon)表实体类
@ -138,6 +139,8 @@ public class CardCoupon extends Model<CardCoupon> {
//当次获取数量
@TableField(exist = false)
private Integer giftCardTotal;
@TableField(exist = false)
private List<String> productIdList;
}

View File

@ -1,7 +1,8 @@
# \u57FA\u672C\u914D\u7F6E
server.port=8080
env.profile=dev
env.properties.path=D:/my_project/oil-station/fuintBackend/configure/
#env.properties.path=D:/my_project/oil-station/fuintBackend/configure/
env.properties.path=D:/Code/yuzhan/oil-station/fuintBackend/configure/
#env.properties.path=F:/work/oilSystem/fuintBackend/configure/
#env.properties.path=D:/oil/new-oil/oilSystem/fuintBackend/configure/
#env.properties.path=D:/work/oilSystem/fuintBackend/configure/