Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e7ebac6b34
@ -1,9 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员详细
|
||||
// 查询配置信息
|
||||
export function getSysConfig(key) {
|
||||
return request({
|
||||
url: '/sysConfig/getByKey/' + key,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改配置信息
|
||||
export function editSysConfig(data) {
|
||||
return request({
|
||||
url: '/sysConfig/updateValue',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="来源油站" prop="storeIds">
|
||||
<el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">
|
||||
<el-option v-for="item in storeList" :key="item.id+''" :label="item.name" :value="item.id+''"/>
|
||||
<el-option v-for="item in storeList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员号" prop="userNo">
|
||||
|
@ -448,7 +448,7 @@ import {
|
||||
updateUserGrade
|
||||
} from "@/api/staff/user/usergrade";
|
||||
import {getChainStoreConfig, updateChainStoreConfig} from "@/api/staff/user/chainstoreconfig";
|
||||
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
||||
import {editSysConfig, getSysConfig} from "@/api/staff/user/sysconfig";
|
||||
export default {
|
||||
name: "UserGradeIndex",
|
||||
dicts: ['yhlx','zhzt','yhhdz'],
|
||||
@ -511,6 +511,11 @@ export default {
|
||||
catchTypeList: [],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 等级开启信息
|
||||
map:{
|
||||
keyStr:"is_enable_level",
|
||||
valueStr:""
|
||||
},
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
// 表单参数
|
||||
@ -583,14 +588,20 @@ export default {
|
||||
});
|
||||
},
|
||||
editLevel1(){
|
||||
this.level1 = false;
|
||||
this.level2 = true;
|
||||
this.$modal.msgSuccess("等级状态更新成功");
|
||||
this.map.valueStr = "yes"
|
||||
editSysConfig(this.map).then(res => {
|
||||
this.level1 = false;
|
||||
this.level2 = true;
|
||||
this.$modal.msgSuccess("等级状态更新成功");
|
||||
})
|
||||
},
|
||||
editLevel2(){
|
||||
this.level1 = true;
|
||||
this.level2 = false;
|
||||
this.$modal.msgSuccess("等级状态更新成功");
|
||||
this.map.valueStr = "no"
|
||||
editSysConfig(this.map).then(res => {
|
||||
this.level1 = true;
|
||||
this.level2 = false;
|
||||
this.$modal.msgSuccess("等级状态更新成功");
|
||||
})
|
||||
},
|
||||
addGasOline(){
|
||||
let temp= {
|
||||
|
@ -78,7 +78,14 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
|
||||
public void ruleCycle(String ruleCycle) {
|
||||
// 如果是单日的话则开启定时任务
|
||||
if (ruleCycle.equals("singleDay")){
|
||||
|
||||
try {
|
||||
// 86400000
|
||||
// Thread.sleep(20000);
|
||||
// System.out.println(1);
|
||||
merchantConfigService.updateMerchIsOpen("0");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
package com.fuint.api.fuyou.util;
|
||||
|
||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class SchudelUtil {
|
||||
@Autowired
|
||||
private MerchantConfigService merchantConfigService;
|
||||
|
||||
@Scheduled(fixedDelay=86400000)
|
||||
public void teak1(){
|
||||
merchantConfigService.updateMerchIsOpen("0");
|
||||
}
|
||||
}
|
@ -123,10 +123,14 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
||||
activeConsumptionVO.setActiveGift(s.getActiveGift().split(","));
|
||||
//获取会员等级
|
||||
String str = "";
|
||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){
|
||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||
}
|
||||
}
|
||||
activeConsumptionVO.setDieselUserLevel(str.split(","));
|
||||
}
|
||||
activeConsumptionVO.setDieselUserLevel(str.split(","));
|
||||
activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList);
|
||||
return activeConsumptionVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
@ -123,10 +123,14 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
|
||||
.toArray(Integer[]::new));
|
||||
//获取会员等级
|
||||
String str = "";
|
||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){
|
||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||
}
|
||||
}
|
||||
activeDiscountVO.setDieselUserLevel(str.split(","));
|
||||
}
|
||||
activeDiscountVO.setDieselUserLevel(str.split(","));
|
||||
activeDiscountVO.setActiveDiscountChildList(activeDiscountChildList);
|
||||
return activeDiscountVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
@ -120,10 +120,14 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
|
||||
.toArray(Integer[]::new));
|
||||
//获取会员等级
|
||||
String str = "";
|
||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
||||
for (String gradeId : s.getDieselUserLevel().split(",")) {
|
||||
if (ObjectUtils.isNotEmpty(userGradeService.selectUserGradeById(Integer.parseInt(gradeId)))){
|
||||
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
|
||||
}
|
||||
}
|
||||
activeFullminusVO.setDieselUserLevel(str.split(","));
|
||||
}
|
||||
activeFullminusVO.setDieselUserLevel(str.split(","));
|
||||
activeFullminusVO.setActiveDiscountChildList(activeDiscountChildList);
|
||||
return activeFullminusVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
@ -91,7 +91,11 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
|
||||
activeRecommendVO.setInviterGiftType(new String[0]);
|
||||
if (ObjectUtils.isNotEmpty(id)){
|
||||
//获取新人有礼活动信息
|
||||
ActiveRecommend activeRecommend = getById(id);
|
||||
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ActiveRecommend::getId,id);
|
||||
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
|
||||
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
|
||||
//ActiveRecommend activeRecommend = getById(id);
|
||||
//获取兑换物品信息
|
||||
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,id);
|
||||
|
@ -117,7 +117,7 @@ public class CardFuelDieselController extends BaseController {
|
||||
cardFuelDiesel.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||
cardFuelDiesel.setChainStorId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
|
||||
}
|
||||
//活动时间
|
||||
|
||||
cardFuelDiesel.setStartTime(new Date());
|
||||
cardFuelDiesel.setEndTime(new Date());
|
||||
cardFuelDiesel.setStatus(cardFuelDiesel.getStatus().equals("true") ? "1" : "2");
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@ -115,11 +116,13 @@ public class CardValueController extends BaseController {
|
||||
queryWrapper.eq(CardValueChild::getCardValueId,id);
|
||||
queryWrapper.orderByDesc(CardValueChild::getCreateTime);
|
||||
List<CardValueChild> activeNewlywedsChildList = cardValueChildService.list(queryWrapper);
|
||||
BeanUtils.copyProperties(cardValue,cardValueVO);
|
||||
cardValueVO.setMembershipLevel(cardValue.getMembershipLevel().split(","));
|
||||
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
|
||||
//封装VO返回
|
||||
BeanUtils.copyProperties(cardValue,cardValueVO);
|
||||
cardValueVO.setMembershipLevel(cardValue.getMembershipLevel().split(","));
|
||||
cardValueVO.setCardValueChildList(activeNewlywedsChildList);
|
||||
}else {
|
||||
cardValueVO.setCardValueChildList(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
return getSuccessResult(cardValueVO);
|
||||
|
@ -48,6 +48,17 @@ public class LJUserGradeController extends BaseController {
|
||||
return getSuccessResult(userGrade);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员等级信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/isUse/{id}")
|
||||
public ResponseObject userGrade(@PathVariable Integer id){
|
||||
LJUserGrade userGrade = userGradeService.selectUserGradeByIdIsUse(id);
|
||||
return getSuccessResult(userGrade);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员等级信息
|
||||
* @param map
|
||||
|
@ -23,6 +23,13 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
|
||||
*/
|
||||
public LJUserGrade selectUserGradeById(int id);
|
||||
|
||||
/**
|
||||
* 根据id查询会员等级信息是否可使用
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public LJUserGrade selectUserGradeByIdIsUse(int id);
|
||||
|
||||
/**
|
||||
* 根据会员等级名称查询会员等级信息
|
||||
* @param name
|
||||
|
@ -12,6 +12,8 @@ import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.system.config.service.SysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@ -41,6 +43,18 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private SysConfigService sysConfigService;
|
||||
|
||||
@Override
|
||||
public LJUserGrade selectUserGradeByIdIsUse(int id) {
|
||||
String isEnableLevel = sysConfigService.getValueByKey("is_enable_level");
|
||||
if (isEnableLevel.equals("yes")){
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LJUserGrade selectUserGradeByName(String name) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
@ -61,7 +75,9 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
public int insertUserGrade(LJUserGrade userGrade) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
Integer num = baseMapper.selectCount(null);
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
Integer num = baseMapper.selectCount(queryWrapper);
|
||||
int row = 0;
|
||||
if (num<20){
|
||||
userGrade.setStoreId(storeId);
|
||||
|
@ -17,6 +17,7 @@ public class AccountInfo implements Serializable {
|
||||
private Integer id;
|
||||
private String accountKey;
|
||||
private String accountName;
|
||||
private String roleName;
|
||||
private int accountStatus;
|
||||
private String isActive;
|
||||
private Date createDate;
|
||||
|
@ -19,7 +19,7 @@ public class SMSUtils {
|
||||
* @param param 参数
|
||||
*/
|
||||
public static void sendMessage(String signName, String templateCode,String phoneNumbers,String param){
|
||||
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "", "");
|
||||
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "LTAI5t7GEqGL46cwjYs6aanu", "d9MpwlyXbHOTrQaA5n8URVz40x5AX3");
|
||||
IAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
SendSmsRequest request = new SendSmsRequest();
|
||||
|
@ -3,6 +3,8 @@ package com.fuint.module.backendApi.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.api.R;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.UserDto;
|
||||
import com.fuint.common.enums.AdminRoleEnum;
|
||||
@ -22,6 +24,7 @@ import com.fuint.system.role.service.DutyService;
|
||||
import com.fuint.utils.StringUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
@ -69,6 +72,8 @@ public class BackendLoginController extends BaseController {
|
||||
* */
|
||||
@Resource
|
||||
private CaptchaService captchaService;
|
||||
@Autowired
|
||||
private LJUserService userService;
|
||||
|
||||
@Autowired
|
||||
public RedisTemplate redisTemplate;
|
||||
@ -119,7 +124,7 @@ public class BackendLoginController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台登录
|
||||
* 发送手机验证码
|
||||
* */
|
||||
@ApiOperation(value = "发送手机验证码")
|
||||
@RequestMapping(value="/sendMsg", method = RequestMethod.POST)
|
||||
@ -128,37 +133,49 @@ public class BackendLoginController extends BaseController {
|
||||
//获取手机号
|
||||
String phone = userDto.getMobile();
|
||||
if(StringUtils.isNotEmpty(phone)){
|
||||
//获取用户信息
|
||||
LJUser ljUser = userService.selectUserByMobile(phone);
|
||||
if (ObjectUtils.isEmpty(ljUser)){
|
||||
return getSuccessResult("用户不存在,请先注册账号!");
|
||||
}
|
||||
//生成随机的四位验证码
|
||||
String code = ValidateCodeUtils.verificationCode(4);
|
||||
//String code = "1234";
|
||||
//调用阿里云提供的短信服务API完成发送短信
|
||||
SMSUtils.sendMessage("蓝鲸智慧油站","SMS_154950909",phone,code);
|
||||
//需要将生成的验证码保存到redis,过期时间60s
|
||||
redisTemplate.opsForValue().set(phone,code,60, TimeUnit.SECONDS);
|
||||
SMSUtils.sendMessage("阿里云短信测试","SMS_154950909",phone,code);
|
||||
//SMSUtils.sendMessage("蓝鲸智慧油站", "SMS_291345282",phone,code);
|
||||
//需要将生成的验证码保存到redis,过期时间300s
|
||||
redisTemplate.opsForValue().set(phone,code,300, TimeUnit.SECONDS);
|
||||
return getSuccessResult("手机验证码发送成功");
|
||||
}
|
||||
return getFailureResult("短信发送失败");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*手机验证码登录
|
||||
* @param map
|
||||
* @param session
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/loginByPhone")
|
||||
public ResponseObject loginByPhone(@RequestBody Map map) {
|
||||
//获取手机号 1234
|
||||
//获取手机号
|
||||
String phone = map.get("mobile").toString();
|
||||
//获取用户信息
|
||||
LJUser ljUser = userService.selectUserByMobile(phone);
|
||||
//获取验证码
|
||||
String code = map.get("code").toString();
|
||||
//从redis中获取保存的验证码
|
||||
Object codeInRedis = redisTemplate.opsForValue().get(phone);
|
||||
//进行验证码的比对
|
||||
if (codeInRedis != null && codeInRedis.equals(code)) {
|
||||
if (codeInRedis != null && codeInRedis.equals(code) && ObjectUtils.isNotEmpty(ljUser)) {
|
||||
//如果能够比对成功,说明登录成功
|
||||
return getSuccessResult("登录成功!");
|
||||
return getSuccessResult("登录成功!",ljUser);
|
||||
}else if (codeInRedis != null && codeInRedis.equals(code) && ObjectUtils.isEmpty(ljUser)){
|
||||
return getSuccessResult("用户不存在,请先注册账号!");
|
||||
}else {
|
||||
return getFailureResult("登录失败,请输入正确的验证码");
|
||||
}
|
||||
return getFailureResult("登录失败,请输入正确的验证码");
|
||||
}
|
||||
/**
|
||||
* 获取登录信息接口
|
||||
@ -168,6 +185,11 @@ public class BackendLoginController extends BaseController {
|
||||
public ResponseObject getInfo(HttpServletRequest request) throws BusinessCheckException {
|
||||
String token = request.getHeader("Access-Token");
|
||||
AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
|
||||
if (ObjectUtils.isNotEmpty(accountInfo.getRoleIds()) &&
|
||||
ObjectUtils.isNotEmpty((long)Integer.parseInt(accountInfo.getRoleIds())) &&
|
||||
ObjectUtils.isNotEmpty(dutyService.getRoleById((long)Integer.parseInt(accountInfo.getRoleIds())))){
|
||||
accountInfo.setRoleName(dutyService.getRoleById((long)Integer.parseInt(accountInfo.getRoleIds())).getDutyName());
|
||||
}
|
||||
if (accountInfo == null) {
|
||||
return getFailureResult(401, "登录信息已失效,请重新登录");
|
||||
}
|
||||
|
@ -90,6 +90,18 @@ public class SysConfigController extends BaseController {
|
||||
return getSuccessResult("成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key修改value
|
||||
*
|
||||
* @param sysConfig 实体对象
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PutMapping("/updateValue")
|
||||
public ResponseObject updateSysConfig(@RequestBody SysConfig sysConfig) {
|
||||
this.sysConfigService.updateSysConfig(sysConfig);
|
||||
return getSuccessResult("成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
|
@ -12,6 +12,12 @@ import com.fuint.system.config.entity.SysConfig;
|
||||
public interface SysConfigService extends IService<SysConfig> {
|
||||
void saveVo(SysConfig sysConfig);
|
||||
void updateByIdVo(SysConfig sysConfig);
|
||||
|
||||
/**
|
||||
* 根据key修改配置信息
|
||||
* @param sysConfig
|
||||
*/
|
||||
void updateSysConfig(SysConfig sysConfig);
|
||||
void removeByIdVo(Long id);
|
||||
String getValueByKey(String keyStr);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.system.config.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.common.util.RedisUtil;
|
||||
import com.fuint.system.config.mapper.SysConfigMapper;
|
||||
@ -34,6 +35,17 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
||||
this.updateById(sysConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSysConfig(SysConfig sysConfig) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("key_str",sysConfig.getKeyStr());
|
||||
SysConfig sysConfig1 = baseMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(sysConfig1)){
|
||||
sysConfig1.setValueStr(sysConfig.getValueStr());
|
||||
baseMapper.updateById(sysConfig1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeByIdVo(Long id) {
|
||||
SysConfig sysConfig = this.getById(id);
|
||||
|
@ -17,6 +17,14 @@ export function getUserGrade(id) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员等级详细是否能使用
|
||||
export function userGradeInfo(id) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/isUse/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据会员等级名称查询会员等级信息
|
||||
export function queryUserGrade(data) {
|
||||
return request({
|
||||
|
@ -782,7 +782,7 @@
|
||||
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
|
||||
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
|
||||
import {addLJGoods, goodsOrder, oilOrder} from "@/api/cashier/oilorder";
|
||||
import {getUserGrade, listUserGrade} from "@/api/cashier/usergrade";
|
||||
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
|
||||
import {getOilGun} from "@/api/cashier/oilGuns";
|
||||
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
|
||||
import {getOilNumberById, oilNumberList} from "@/api/cashier/oilnumber";
|
||||
@ -1421,228 +1421,230 @@
|
||||
this.gradeDiscount = [];
|
||||
getSysConfig('is_enable_level').then(res => {
|
||||
if (res.data=="yes") {
|
||||
getUserGrade(id).then(response => {
|
||||
userGradeInfo(id).then(response => {
|
||||
let gasolineDiscount = 0;
|
||||
let dieselDiscount = 0;
|
||||
let naturalGasDiscount = 0;
|
||||
_this.gradeDiscount = [];
|
||||
_this.oilOrder.forEach(item => {
|
||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||
if (item.type == "汽油") {
|
||||
let gasolineRule = JSON.parse(response.data.gasolineRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
if (response.data!=null) {
|
||||
_this.oilOrder.forEach(item => {
|
||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||
if (item.type == "汽油") {
|
||||
let gasolineRule = JSON.parse(response.data.gasolineRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else if (response.data.gasolineDiscount == "每升优惠") {
|
||||
discount.type = "每升优惠"
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == "柴油") {
|
||||
let dieselRule = JSON.parse(response.data.dieselRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else if (response.data.dieselDiscount == "每升优惠") {
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else if (response.data.gasolineDiscount == "每升优惠") {
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||
break;
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == "柴油") {
|
||||
let dieselRule = JSON.parse(response.data.dieselRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else if (response.data.dieselDiscount == "每升优惠") {
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else {
|
||||
dieselDiscount = 0;
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else {
|
||||
dieselDiscount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == "天然气") {
|
||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.naturalGasDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
if (item.type == "天然气") {
|
||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.naturalGasDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else if (response.data.naturalGasDiscount == "每单位优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else if (response.data.naturalGasDiscount == "每单位优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
console.log(response)
|
||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||
_this.checkAll2 = true;
|
||||
_this.isExclusion();
|
||||
@ -1682,7 +1684,7 @@
|
||||
_this.couponIds = response.data
|
||||
if (response.data.length>0){
|
||||
response.data.forEach(item => {
|
||||
_this.useCouponIds.push(item.id)
|
||||
_this.useCouponIds = item.id
|
||||
let discount = {type:item.type,discountType:item.discountType,name:item.name,oilName:item1.oilName,full:0,reduce:0,discount:0}
|
||||
discount.full = item.satisfiedAmount
|
||||
if (item.type==0){
|
||||
|
Loading…
Reference in New Issue
Block a user