修改套餐功能

This commit is contained in:
wuweihua
2026-09-20 10:31:12 +08:00
parent 72d23a0e23
commit 8d1abf0eb1
3 changed files with 9 additions and 20 deletions
@@ -69,10 +69,6 @@ public class BmsCustomerPriceSetServiceImpl implements IBmsCustomerPriceSetServi
throw new ServiceException("仅生效中的套餐允许绑定,当前套餐状态不可用"); throw new ServiceException("仅生效中的套餐允许绑定,当前套餐状态不可用");
} }
if (bind.getPrBegindate() == null) if (bind.getPrBegindate() == null)
{
bind.setPrBegindate(set.getEffectiveDate());
}
if (bind.getPrBegindate() == null)
{ {
throw new ServiceException("绑定生效日期不能为空"); throw new ServiceException("绑定生效日期不能为空");
} }
@@ -22,8 +22,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="priceSetName" column="price_set_name" /> <result property="priceSetName" column="price_set_name" />
<result property="setType" column="set_type" /> <result property="setType" column="set_type" />
<result property="priceSetStatus" column="price_set_status" /> <result property="priceSetStatus" column="price_set_status" />
<result property="setEffectiveDate" column="set_effective_date" />
<result property="setExpireDate" column="set_expire_date" />
</resultMap> </resultMap>
<resultMap type="com.ruoyi.customer.customerinfo.domain.BmsPriceSetOption" id="BmsPriceSetOptionResult"> <resultMap type="com.ruoyi.customer.customerinfo.domain.BmsPriceSetOption" id="BmsPriceSetOptionResult">
@@ -32,8 +30,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="priceSetName" column="price_set_name" /> <result property="priceSetName" column="price_set_name" />
<result property="setType" column="set_type" /> <result property="setType" column="set_type" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="effectiveDate" column="effective_date" />
<result property="expireDate" column="expire_date" />
</resultMap> </resultMap>
<sql id="bindVo"> <sql id="bindVo">
@@ -41,8 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.bind_priority, c.pr_begindate, c.pr_enddate, c.price_set_note, c.bind_priority, c.pr_begindate, c.pr_enddate, c.price_set_note,
c.created_by, c.create_time, c.updated_by, c.update_time, c.created_by, c.create_time, c.updated_by, c.update_time,
s.price_set_code, s.price_set_name, s.set_type, s.price_set_code, s.price_set_name, s.set_type,
s.status as price_set_status, s.status as price_set_status
s.effective_date as set_effective_date, s.expire_date as set_expire_date
from prc_customer_price_set c from prc_customer_price_set c
left join prc_price_set s on s.price_set_id = c.price_set_id left join prc_price_set s on s.price_set_id = c.price_set_id
</sql> </sql>
@@ -104,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPriceSetOptionList" <select id="selectPriceSetOptionList"
parameterType="com.ruoyi.customer.customerinfo.domain.BmsPriceSetOption" parameterType="com.ruoyi.customer.customerinfo.domain.BmsPriceSetOption"
resultMap="BmsPriceSetOptionResult"> resultMap="BmsPriceSetOptionResult">
select price_set_id, price_set_code, price_set_name, set_type, status, effective_date, expire_date select price_set_id, price_set_code, price_set_name, set_type, status
from prc_price_set from prc_price_set
<where> <where>
status = 'E' status = 'E'
@@ -120,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectPriceSetOptionById" resultMap="BmsPriceSetOptionResult"> <select id="selectPriceSetOptionById" resultMap="BmsPriceSetOptionResult">
select price_set_id, price_set_code, price_set_name, set_type, status, effective_date, expire_date select price_set_id, price_set_code, price_set_name, set_type, status
from prc_price_set from prc_price_set
where price_set_id = #{priceSetId} where price_set_id = #{priceSetId}
</select> </select>
@@ -666,9 +666,9 @@
<el-tag size="small" :type="selectedPriceSet.setType === 'DISCOUNT' ? 'warning' : 'primary'"> <el-tag size="small" :type="selectedPriceSet.setType === 'DISCOUNT' ? 'warning' : 'primary'">
{{ setTypeMap[selectedPriceSet.setType] || selectedPriceSet.setType }} {{ setTypeMap[selectedPriceSet.setType] || selectedPriceSet.setType }}
</el-tag> </el-tag>
<span class="ps-readonly__range"> <el-tag size="small" :type="priceSetStatusTagType[selectedPriceSet.status] || 'info'" class="ps-readonly__status">
套餐有效期:{{ selectedPriceSet.effectiveDate || '-' }} 至 {{ selectedPriceSet.expireDate || '长期' }} {{ priceSetStatusMap[selectedPriceSet.status] || selectedPriceSet.status || '-' }}
</span> </el-tag>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="优先级" prop="bindPriority"> <el-form-item label="优先级" prop="bindPriority">
@@ -855,12 +855,10 @@ function openPriceSetDialog(row) {
nextTick(() => proxy.$refs['priceSetRef'] && proxy.$refs['priceSetRef'].clearValidate()) nextTick(() => proxy.$refs['priceSetRef'] && proxy.$refs['priceSetRef'].clearValidate())
} }
/** 选择套餐后,生效日期未填时默认带出套餐生效日期 */ /** 选择套餐后,生效日期未填时默认今天 */
function onPriceSetChange(priceSetId) { function onPriceSetChange(priceSetId) {
const opt = priceSetOptions.value.find(o => o.priceSetId === priceSetId) if (!priceSetId || priceSetForm.value.prBegindate) return
if (opt && !priceSetForm.value.prBegindate) { priceSetForm.value.prBegindate = proxy.parseTime(new Date(), '{y}-{m}-{d}')
priceSetForm.value.prBegindate = opt.effectiveDate || null
}
} }
function submitPriceSetForm() { function submitPriceSetForm() {