Compare commits

..

No commits in common. "af92c1ca0063d3293f9293e74fbf2af7908edc71" and "53128f06855cbed1eb6976ae38cc7a2702ff69aa" have entirely different histories.

3 changed files with 10 additions and 20 deletions

View File

@ -67,8 +67,7 @@ export const CouponValidTerm = defineComponent({
coupon.validEndTime,
'YYYY-MM-DD'
)}`
// : `领取后第 ${coupon.fixedStartTerm} - ${coupon.fixedEndTerm} 天内可用`
: `领取后 ${coupon.fixedEndTerm} 天内可用`
: `领取后第 ${coupon.fixedStartTerm} - ${coupon.fixedEndTerm} 天内可用`
return () => <div>{text}</div>
}
})

View File

@ -28,8 +28,7 @@ export const validityTypeFormat = (row: CouponTemplateVO) => {
return `${formatDate(row.validStartTime)}${formatDate(row.validEndTime)}`
}
if (row.validityType === CouponTemplateValidityTypeEnum.TERM.type) {
// return `领取后第 ${row.fixedStartTerm} - ${row.fixedEndTerm} 天内可用`
return `领取后 ${row.fixedEndTerm + 1} 天内可用`
return `领取后第 ${row.fixedStartTerm} - ${row.fixedEndTerm} 天内可用`
}
return '未知【' + row.validityType + '】'
}

View File

@ -38,7 +38,7 @@
<el-form-item label="优惠类型" prop="discountType">
<el-radio-group v-model="formData.discountType">
<el-radio
v-for="dict in filteredDictOptions()"
v-for="dict in getIntDictOptions(DICT_TYPE.PROMOTION_DISCOUNT_TYPE)"
:key="dict.value"
:label="dict.value"
>
@ -151,10 +151,10 @@
</el-form-item>
<el-form-item
v-if="formData.validityType === CouponTemplateValidityTypeEnum.TERM.type"
label="有效日期"
label="领取日期"
prop="fixedStartTerm"
>
<!--
<el-input-number
v-model="formData.fixedStartTerm"
:min="0"
@ -162,13 +162,13 @@
class="mx-2"
placeholder="0 为今天生效"
/>
-->
<el-input-number
v-model="formData.fixedEndTerm"
:min="1"
:min="0"
:precision="0"
class="mx-2"
placeholder="请输入有效天数"
placeholder="请输入结束天数"
/>
天有效
</el-form-item>
@ -215,7 +215,7 @@ const formData = ref({
validTimes: [],
validStartTime: undefined,
validEndTime: undefined,
fixedStartTerm: 0,
fixedStartTerm: undefined,
fixedEndTerm: undefined,
productScope: PromotionProductScopeEnum.ALL.scope,
productScopeValues: [], //
@ -255,7 +255,6 @@ const open = async (type: string, id?: number) => {
const data = await CouponTemplateApi.getCouponTemplate(id)
formData.value = {
...data,
fixedEndTerm: data.fixedEndTerm - data.fixedStartTerm + 1, // +1
discountPrice: formatToFraction(data.discountPrice),
discountPercent:
data.discountPercent !== undefined ? data.discountPercent / 10.0 : undefined,
@ -284,7 +283,6 @@ const submitForm = async () => {
try {
const data = {
...formData.value,
fixedEndTerm: (formData.value.fixedEndTerm || 0) + formData.value.fixedStartTerm - 1, //
discountPrice: convertToInteger(formData.value.discountPrice),
discountPercent:
formData.value.discountPercent !== undefined
@ -337,7 +335,7 @@ const resetForm = () => {
validTimes: [],
validStartTime: undefined,
validEndTime: undefined,
fixedStartTerm: 0,
fixedStartTerm: undefined,
fixedEndTerm: undefined,
productScope: PromotionProductScopeEnum.ALL.scope,
productScopeValues: [],
@ -385,12 +383,6 @@ function setProductScopeValues(data: CouponTemplateApi.CouponTemplateVO) {
break
}
}
/** 暂时隐藏掉字典中的折扣 */
function filteredDictOptions() {
return getIntDictOptions(DICT_TYPE.PROMOTION_DISCOUNT_TYPE).filter(
dict => dict.value !== 2 // value 2
);
}
</script>
<style lang="scss" scoped></style>