mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-17 08:18:34 +08:00
配置充电停车优惠
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
package com.jsowell.web.controller.pile;
|
||||||
|
|
||||||
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
|
import com.jsowell.pile.domain.ChargeParkingDiscount;
|
||||||
|
import com.jsowell.pile.service.ChargeParkingDiscountService;
|
||||||
|
import com.jsowell.pile.vo.web.ChargeParkingDiscountVO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电停车优惠
|
||||||
|
*
|
||||||
|
* @author xxxxx
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pile/station")
|
||||||
|
public class ChargeParkingDiscountController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ChargeParkingDiscountService chargeParkingDiscountService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存充电停车优惠配置
|
||||||
|
*/
|
||||||
|
@PostMapping("/saveChargeParkingDiscount")
|
||||||
|
public AjaxResult saveChargeParkingDiscount(@RequestBody ChargeParkingDiscount chargeParkingDiscount) {
|
||||||
|
int result = chargeParkingDiscountService.insertOrUpdateSelective(chargeParkingDiscount);
|
||||||
|
if (result > 0) {
|
||||||
|
return success();
|
||||||
|
} else {
|
||||||
|
return error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询站点充电停车优惠配置
|
||||||
|
*/
|
||||||
|
@GetMapping("/getChargeParkingDiscount/{stationId}")
|
||||||
|
public AjaxResult getChargeParkingDiscount(@PathVariable("stationId") String stationId) {
|
||||||
|
ChargeParkingDiscountVO chargeParkingDiscountVO = chargeParkingDiscountService.getChargeParkingDiscount(stationId);
|
||||||
|
return AjaxResult.success(chargeParkingDiscountVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.jsowell.pile.domain;
|
package com.jsowell.pile.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -8,9 +7,12 @@ import lombok.NoArgsConstructor;
|
|||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电停车优惠表
|
* 充电停车优惠表
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@@ -19,66 +21,66 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ChargeParkingDiscount {
|
public class ChargeParkingDiscount {
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
*/
|
*/
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点id
|
* 站点id
|
||||||
*/
|
*/
|
||||||
private String stationId;
|
private String stationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 道闸平台id
|
* 道闸平台id
|
||||||
*/
|
*/
|
||||||
private Integer parkingPlatformId;
|
private Integer parkingPlatformId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 条件类型(1-固定电量;2-固定时长)
|
* 条件类型(1-固定电量;2-固定时长)
|
||||||
*/
|
*/
|
||||||
private String conditionType;
|
private String conditionType;
|
||||||
|
|
||||||
private String conditionValue;
|
private String conditionValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 优惠类型(1-减时间单位分钟; 2-减金额单位元)
|
* 优惠类型(1-减时间单位分钟; 2-减金额单位元)
|
||||||
*/
|
*/
|
||||||
private String discountType;
|
private String discountType;
|
||||||
|
|
||||||
private String discountValue;
|
private String discountValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
private Date startTime;
|
private LocalTime startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
private Date endTime;
|
private LocalTime endTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 创建人
|
||||||
*/
|
*/
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新人
|
* 更新人
|
||||||
*/
|
*/
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新时间
|
* 更新时间
|
||||||
*/
|
*/
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除标识(0-正常; 1-删除)
|
* 删除标识(0-正常; 1-删除)
|
||||||
*/
|
*/
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.jsowell.pile.mapper;
|
package com.jsowell.pile.mapper;
|
||||||
|
|
||||||
import com.jsowell.pile.domain.ChargeParkingDiscount;
|
import com.jsowell.pile.domain.ChargeParkingDiscount;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
public interface ChargeParkingDiscountMapper {
|
public interface ChargeParkingDiscountMapper {
|
||||||
int deleteByPrimaryKey(Integer id);
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.jsowell.pile.service.impl;
|
package com.jsowell.pile.service.impl;
|
||||||
|
|
||||||
import com.jsowell.common.util.DateUtils;
|
import com.jsowell.common.util.SecurityUtils;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.pile.domain.ChargeParkingDiscount;
|
import com.jsowell.pile.domain.ChargeParkingDiscount;
|
||||||
import com.jsowell.pile.mapper.ChargeParkingDiscountMapper;
|
import com.jsowell.pile.mapper.ChargeParkingDiscountMapper;
|
||||||
@@ -52,8 +52,8 @@ public class ChargeParkingDiscountServiceImpl implements ChargeParkingDiscountSe
|
|||||||
discountVO.setConditionValue(chargeParkingDiscount.getConditionValue());
|
discountVO.setConditionValue(chargeParkingDiscount.getConditionValue());
|
||||||
discountVO.setDiscountType(chargeParkingDiscount.getDiscountType());
|
discountVO.setDiscountType(chargeParkingDiscount.getDiscountType());
|
||||||
discountVO.setDiscountValue(chargeParkingDiscount.getDiscountValue());
|
discountVO.setDiscountValue(chargeParkingDiscount.getDiscountValue());
|
||||||
discountVO.setStartTime(DateUtils.formatDateTime(chargeParkingDiscount.getStartTime()));
|
discountVO.setStartTime(chargeParkingDiscount.getStartTime());
|
||||||
discountVO.setEndTime(DateUtils.formatDateTime(chargeParkingDiscount.getEndTime()));
|
discountVO.setEndTime(chargeParkingDiscount.getEndTime());
|
||||||
return discountVO;
|
return discountVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +79,11 @@ public class ChargeParkingDiscountServiceImpl implements ChargeParkingDiscountSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertOrUpdateSelective(ChargeParkingDiscount record) {
|
public int insertOrUpdateSelective(ChargeParkingDiscount record) {
|
||||||
|
if (record.getId() == null) {
|
||||||
|
record.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
} else {
|
||||||
|
record.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
}
|
||||||
return chargeParkingDiscountMapper.insertOrUpdateSelective(record);
|
return chargeParkingDiscountMapper.insertOrUpdateSelective(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.jsowell.pile.vo.web;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电停车优惠VO
|
* 充电停车优惠VO
|
||||||
*/
|
*/
|
||||||
@@ -37,10 +39,10 @@ public class ChargeParkingDiscountVO {
|
|||||||
/**
|
/**
|
||||||
* 优惠生效时间
|
* 优惠生效时间
|
||||||
*/
|
*/
|
||||||
private String startTime;
|
private LocalTime startTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 优惠失效时间
|
* 优惠失效时间
|
||||||
*/
|
*/
|
||||||
private String endTime;
|
private LocalTime endTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
<result column="condition_value" jdbcType="VARCHAR" property="conditionValue" />
|
<result column="condition_value" jdbcType="VARCHAR" property="conditionValue" />
|
||||||
<result column="discount_type" jdbcType="VARCHAR" property="discountType" />
|
<result column="discount_type" jdbcType="VARCHAR" property="discountType" />
|
||||||
<result column="discount_value" jdbcType="VARCHAR" property="discountValue" />
|
<result column="discount_value" jdbcType="VARCHAR" property="discountValue" />
|
||||||
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
<result column="start_time" jdbcType="TIME" property="startTime" />
|
||||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
<result column="end_time" jdbcType="TIME" property="endTime" />
|
||||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||||
@@ -146,10 +146,10 @@
|
|||||||
discount_value = #{discountValue,jdbcType=VARCHAR},
|
discount_value = #{discountValue,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime != null">
|
<if test="startTime != null">
|
||||||
start_time = #{startTime,jdbcType=TIMESTAMP},
|
start_time = #{startTime,jdbcType=TIME},
|
||||||
</if>
|
</if>
|
||||||
<if test="endTime != null">
|
<if test="endTime != null">
|
||||||
end_time = #{endTime,jdbcType=TIMESTAMP},
|
end_time = #{endTime,jdbcType=TIME},
|
||||||
</if>
|
</if>
|
||||||
<if test="createBy != null">
|
<if test="createBy != null">
|
||||||
create_by = #{createBy,jdbcType=VARCHAR},
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
@@ -218,14 +218,14 @@
|
|||||||
<trim prefix="start_time = case" suffix="end,">
|
<trim prefix="start_time = case" suffix="end,">
|
||||||
<foreach collection="list" index="index" item="item">
|
<foreach collection="list" index="index" item="item">
|
||||||
<if test="item.startTime != null">
|
<if test="item.startTime != null">
|
||||||
when id = #{item.id,jdbcType=INTEGER} then #{item.startTime,jdbcType=TIMESTAMP}
|
when id = #{item.id,jdbcType=INTEGER} then #{item.startTime,jdbcType=TIME}
|
||||||
</if>
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="end_time = case" suffix="end,">
|
<trim prefix="end_time = case" suffix="end,">
|
||||||
<foreach collection="list" index="index" item="item">
|
<foreach collection="list" index="index" item="item">
|
||||||
<if test="item.endTime != null">
|
<if test="item.endTime != null">
|
||||||
when id = #{item.id,jdbcType=INTEGER} then #{item.endTime,jdbcType=TIMESTAMP}
|
when id = #{item.id,jdbcType=INTEGER} then #{item.endTime,jdbcType=TIME}
|
||||||
</if>
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
</trim>
|
</trim>
|
||||||
@@ -281,7 +281,7 @@
|
|||||||
(#{item.stationId,jdbcType=VARCHAR}, #{item.parkingPlatformId,jdbcType=INTEGER},
|
(#{item.stationId,jdbcType=VARCHAR}, #{item.parkingPlatformId,jdbcType=INTEGER},
|
||||||
#{item.conditionType,jdbcType=VARCHAR}, #{item.conditionValue,jdbcType=VARCHAR},
|
#{item.conditionType,jdbcType=VARCHAR}, #{item.conditionValue,jdbcType=VARCHAR},
|
||||||
#{item.discountType,jdbcType=VARCHAR}, #{item.discountValue,jdbcType=VARCHAR},
|
#{item.discountType,jdbcType=VARCHAR}, #{item.discountValue,jdbcType=VARCHAR},
|
||||||
#{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.createBy,jdbcType=VARCHAR},
|
#{item.startTime,jdbcType=TIME}, #{item.endTime,jdbcType=TIME}, #{item.createBy,jdbcType=VARCHAR},
|
||||||
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
||||||
#{item.delFlag,jdbcType=CHAR})
|
#{item.delFlag,jdbcType=CHAR})
|
||||||
</foreach>
|
</foreach>
|
||||||
@@ -337,8 +337,8 @@
|
|||||||
condition_value = #{conditionValue,jdbcType=VARCHAR},
|
condition_value = #{conditionValue,jdbcType=VARCHAR},
|
||||||
discount_type = #{discountType,jdbcType=VARCHAR},
|
discount_type = #{discountType,jdbcType=VARCHAR},
|
||||||
discount_value = #{discountValue,jdbcType=VARCHAR},
|
discount_value = #{discountValue,jdbcType=VARCHAR},
|
||||||
start_time = #{startTime,jdbcType=TIMESTAMP},
|
start_time = #{startTime,jdbcType=TIME},
|
||||||
end_time = #{endTime,jdbcType=TIMESTAMP},
|
end_time = #{endTime,jdbcType=TIME},
|
||||||
create_by = #{createBy,jdbcType=VARCHAR},
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
update_by = #{updateBy,jdbcType=VARCHAR},
|
update_by = #{updateBy,jdbcType=VARCHAR},
|
||||||
@@ -462,10 +462,10 @@
|
|||||||
discount_value = #{discountValue,jdbcType=VARCHAR},
|
discount_value = #{discountValue,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="startTime != null">
|
<if test="startTime != null">
|
||||||
start_time = #{startTime,jdbcType=TIMESTAMP},
|
start_time = #{startTime,jdbcType=TIME},
|
||||||
</if>
|
</if>
|
||||||
<if test="endTime != null">
|
<if test="endTime != null">
|
||||||
end_time = #{endTime,jdbcType=TIMESTAMP},
|
end_time = #{endTime,jdbcType=TIME},
|
||||||
</if>
|
</if>
|
||||||
<if test="createBy != null">
|
<if test="createBy != null">
|
||||||
create_by = #{createBy,jdbcType=VARCHAR},
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
|
|||||||
@@ -173,3 +173,20 @@ export function updateThirdPartyStationRelation(data) {
|
|||||||
data: data,
|
data: data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存充电停车优惠配置
|
||||||
|
export function saveChargeParkingDiscount(data) {
|
||||||
|
return request({
|
||||||
|
url: '/pile/station/saveChargeParkingDiscount',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询站点充电停车优惠配置
|
||||||
|
export function getChargeParkingDiscount(stationId) {
|
||||||
|
return request({
|
||||||
|
url: '/pile/station/getChargeParkingDiscount/' + stationId,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ export function formatDate(cellValue) {
|
|||||||
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
|
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function formatTimeStr(time) {
|
||||||
|
return `${time.getHours()}:${time.getMinutes()}:${time.getSeconds()}`;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} time
|
* @param {number} time
|
||||||
* @param {string} option
|
* @param {string} option
|
||||||
|
|||||||
@@ -193,92 +193,106 @@
|
|||||||
|
|
||||||
<el-card style="margin-bottom: 10px">
|
<el-card style="margin-bottom: 10px">
|
||||||
<h2>绑定停车平台V2(配置完成后,订单完成将自动下发优惠券)</h2>
|
<h2>绑定停车平台V2(配置完成后,订单完成将自动下发优惠券)</h2>
|
||||||
<el-button
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="big"
|
|
||||||
@click="parkingOpenEdit"
|
|
||||||
v-has-permi="['pile:station:edit']"
|
|
||||||
>编辑参数
|
|
||||||
</el-button>
|
|
||||||
<el-form
|
<el-form
|
||||||
ref="parkingForm"
|
ref="parkingForm"
|
||||||
:model="parkingInfo"
|
:model="chargeParkingDiscount"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
label-width="200px"
|
label-width="200px"
|
||||||
style="margin-top: 10px"
|
style="margin-top: 10px"
|
||||||
>
|
>
|
||||||
|
<!-- 新增规则配置部分 -->
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="5">
|
|
||||||
<el-form-item label="停车平台名称:" prop="type">
|
|
||||||
<el-select
|
|
||||||
v-model="parkingInfo.parkingName"
|
|
||||||
placeholder="请选择停车平台名称"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 220px"
|
|
||||||
:disabled="parkingDisableFlag"
|
|
||||||
@change="getParkingInfo($event)"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in parkingInfoList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.parkingName"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item>
|
<el-form-item label="条件类型:" prop="conditionType">
|
||||||
<el-button
|
<el-radio-group v-model="chargeParkingDiscount.conditionType">
|
||||||
size="big"
|
<el-radio :label="1">固定电量</el-radio>
|
||||||
@click="saveParkingSetting(parkingInfo.id)"
|
<el-radio :label="2">固定时长</el-radio>
|
||||||
v-has-permi="['pile:station:edit']"
|
</el-radio-group>
|
||||||
>
|
|
||||||
保存
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="停车场库secretKey:" prop="secretKey">
|
|
||||||
<el-input
|
|
||||||
placeholder="请输入"
|
|
||||||
v-model="parkingInfo.secretKey"
|
|
||||||
:disabled="true"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="停车场库appId:" prop="appId">
|
<el-form-item label="条件值:" prop="conditionValue">
|
||||||
<el-input
|
<el-input
|
||||||
placeholder="请输入"
|
v-model="chargeParkingDiscount.conditionValue"
|
||||||
v-model="parkingInfo.appId"
|
placeholder="请输入数值"
|
||||||
:disabled="true"
|
type="number"
|
||||||
|
min="0"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="票券id:" prop="couponId">
|
<el-form-item label="优惠类型:" prop="discountType">
|
||||||
<el-input
|
<el-radio-group v-model="chargeParkingDiscount.discountType">
|
||||||
placeholder="请输入"
|
<el-radio :label="1">减时间(分钟)</el-radio>
|
||||||
v-model="parkingInfo.couponId"
|
<el-radio :label="2">减金额(元)</el-radio>
|
||||||
:disabled="false"
|
</el-radio-group>
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="停车场库商户id:" prop="parkingMerchantId">
|
<el-form-item label="优惠值:" prop="discountValue">
|
||||||
<el-input
|
<el-input
|
||||||
placeholder="请输入"
|
v-model="chargeParkingDiscount.discountValue"
|
||||||
v-model="parkingInfo.parkingMerchantId"
|
placeholder="请输入数值"
|
||||||
:disabled="false"
|
type="number"
|
||||||
|
min="0"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="生效时间:" prop="timeRange">
|
||||||
|
<!-- 开始时间 -->
|
||||||
|
<el-time-select
|
||||||
|
v-model="chargeParkingDiscount.startTime"
|
||||||
|
placeholder="起始时间"
|
||||||
|
:picker-options="{
|
||||||
|
start: '00:00',
|
||||||
|
step: '00:30',
|
||||||
|
end: '23:59'
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
<span class="separator">至</span>
|
||||||
|
<!-- 结束时间 -->
|
||||||
|
<el-time-select
|
||||||
|
v-model="chargeParkingDiscount.endTime"
|
||||||
|
placeholder="结束时间"
|
||||||
|
:picker-options="{
|
||||||
|
start: '00:00',
|
||||||
|
step: '00:30',
|
||||||
|
end: '23:59',
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 跨天提示 -->
|
||||||
|
<div v-if="isCrossDay" class="cross-day-tip">
|
||||||
|
<i class="el-icon-warning"></i>
|
||||||
|
已跨天(次日 {{ chargeParkingDiscount.endTime }} 结束)
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button
|
||||||
|
size="big"
|
||||||
|
@click="saveChargeParkingDiscount"
|
||||||
|
v-has-permi="['pile:station:edit']"
|
||||||
|
>
|
||||||
|
保存充电停车优惠配置
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@@ -350,11 +364,12 @@ import {
|
|||||||
getParkingInfoList,
|
getParkingInfoList,
|
||||||
bindParkingPlatform,
|
bindParkingPlatform,
|
||||||
getRelationByStationId,
|
getRelationByStationId,
|
||||||
updateThirdPartyStationRelation,
|
updateThirdPartyStationRelation, saveChargeParkingDiscount,
|
||||||
} from "@/api/pile/station";
|
} from "@/api/pile/station";
|
||||||
import Whitelist from "@/views/pile/station/stationWhiteList";
|
import Whitelist from "@/views/pile/station/stationWhiteList";
|
||||||
import OrderReport from "./orderReport.vue";
|
import OrderReport from "./orderReport.vue";
|
||||||
import Config from "@/views/pile/station/splitConfig.vue";
|
import Config from "@/views/pile/station/splitConfig.vue";
|
||||||
|
import {formatTime, formatTimeStr} from "@/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dicts: ["third_party_type"],
|
dicts: ["third_party_type"],
|
||||||
@@ -378,6 +393,15 @@ export default {
|
|||||||
prefix: "",
|
prefix: "",
|
||||||
},
|
},
|
||||||
parkingInfo: {},
|
parkingInfo: {},
|
||||||
|
chargeParkingDiscount:{
|
||||||
|
stationId: "",
|
||||||
|
conditionType: "",
|
||||||
|
conditionValue: "",
|
||||||
|
discountType: "",
|
||||||
|
discountValue: "",
|
||||||
|
startTime: "",
|
||||||
|
endTime: ""
|
||||||
|
},
|
||||||
parkingInfoList: [],
|
parkingInfoList: [],
|
||||||
queryGroundLockQrCode: "",
|
queryGroundLockQrCode: "",
|
||||||
dialogTitle: "",
|
dialogTitle: "",
|
||||||
@@ -410,6 +434,15 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.initializeData(this.activeName);
|
this.initializeData(this.activeName);
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 判断是否跨天
|
||||||
|
isCrossDay() {
|
||||||
|
if (!this.chargeParkingDiscount.startTime || !this.chargeParkingDiscount.endTime) return false
|
||||||
|
const start = this.timeToMinutes(this.chargeParkingDiscount.startTime)
|
||||||
|
const end = this.timeToMinutes(this.chargeParkingDiscount.endTime)
|
||||||
|
return end <= start
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 更新页面title显示
|
// 更新页面title显示
|
||||||
updateTitle() {
|
updateTitle() {
|
||||||
@@ -571,6 +604,21 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 时间转换为分钟数
|
||||||
|
timeToMinutes(time) {
|
||||||
|
const [hours, minutes] = time.split(':').map(Number)
|
||||||
|
return hours * 60 + minutes
|
||||||
|
},
|
||||||
|
|
||||||
|
// 保存充电停车配置
|
||||||
|
saveChargeParkingDiscount() {
|
||||||
|
this.chargeParkingDiscount.stationId = this.stationId;
|
||||||
|
saveChargeParkingDiscount(this.chargeParkingDiscount).then((response) => {
|
||||||
|
console.log("response", response);
|
||||||
|
this.$message.success(response.msg);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 绑定站点与停车平台配置
|
// 绑定站点与停车平台配置
|
||||||
saveParkingSetting(parkingId) {
|
saveParkingSetting(parkingId) {
|
||||||
console.log("parkingId", parkingId, this.stationId);
|
console.log("parkingId", parkingId, this.stationId);
|
||||||
@@ -618,6 +666,7 @@ export default {
|
|||||||
this.exchange.push(id);
|
this.exchange.push(id);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
//监听复选框状态
|
//监听复选框状态
|
||||||
watch: {
|
watch: {
|
||||||
checkList: {
|
checkList: {
|
||||||
@@ -644,4 +693,24 @@ export default {
|
|||||||
::v-deep .Input .el-input--medium {
|
::v-deep .Input .el-input--medium {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
}
|
}
|
||||||
|
.time-range-picker {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.separator {
|
||||||
|
color: #606266;
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cross-day-tip {
|
||||||
|
color: #e6a23c;
|
||||||
|
margin-left: 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user