mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 04:08:44 +08:00 
			
		
		
		
	【功能修复】商城:指定发卷、新人卷,支持无限发放的兜底
This commit is contained in:
		@@ -33,8 +33,19 @@ export const validityTypeFormat = (row: CouponTemplateVO) => {
 | 
			
		||||
  return '未知【' + row.validityType + '】'
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 格式化【totalCount】
 | 
			
		||||
export const totalCountFormat = (row: CouponTemplateVO) => {
 | 
			
		||||
  if (row.totalCount === -1) {
 | 
			
		||||
    return '不限制'
 | 
			
		||||
  }
 | 
			
		||||
  return row.totalCount
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 格式化【剩余数量】
 | 
			
		||||
export const remainedCountFormat = (row: CouponTemplateVO) => {
 | 
			
		||||
  if (row.totalCount === -1) {
 | 
			
		||||
    return '不限制'
 | 
			
		||||
  }
 | 
			
		||||
  return row.totalCount - row.takeCount
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -115,6 +115,7 @@
 | 
			
		||||
        <el-radio-group v-model="formData.takeType">
 | 
			
		||||
          <el-radio :key="1" :value="1">直接领取</el-radio>
 | 
			
		||||
          <el-radio :key="2" :value="2">指定发放</el-radio>
 | 
			
		||||
          <el-radio :key="2" :value="3">新人卷</el-radio>
 | 
			
		||||
        </el-radio-group>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item v-if="formData.takeType === 1" label="发放数量" prop="totalCount">
 | 
			
		||||
@@ -309,7 +310,9 @@ const submitForm = async () => {
 | 
			
		||||
      validEndTime:
 | 
			
		||||
        formData.value.validTimes && formData.value.validTimes.length === 2
 | 
			
		||||
          ? formData.value.validTimes[1]
 | 
			
		||||
          : undefined
 | 
			
		||||
          : undefined,
 | 
			
		||||
      totalCount: formData.value.takeType === 1 ? formData.value.totalCount : -1,
 | 
			
		||||
      takeLimitCount: formData.value.takeType === 1 ? formData.value.takeLimitCount : -1
 | 
			
		||||
    } as unknown as CouponTemplateApi.CouponTemplateVO
 | 
			
		||||
 | 
			
		||||
    // 设置商品范围
 | 
			
		||||
 
 | 
			
		||||
@@ -109,7 +109,12 @@
 | 
			
		||||
        prop="validityType"
 | 
			
		||||
        width="185"
 | 
			
		||||
      />
 | 
			
		||||
      <el-table-column align="center" label="发放数量" prop="totalCount" />
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        :formatter="totalCountFormat"
 | 
			
		||||
        align="center"
 | 
			
		||||
        label="发放数量"
 | 
			
		||||
        prop="totalCount"
 | 
			
		||||
      />
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        :formatter="remainedCountFormat"
 | 
			
		||||
        align="center"
 | 
			
		||||
@@ -189,6 +194,7 @@ import {
 | 
			
		||||
  discountFormat,
 | 
			
		||||
  remainedCountFormat,
 | 
			
		||||
  takeLimitCountFormat,
 | 
			
		||||
  totalCountFormat,
 | 
			
		||||
  validityTypeFormat
 | 
			
		||||
} from '@/views/mall/promotion/coupon/formatter'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user