fix: refine group-buy product form validation
| | |
| | | |
| | | .product-form-grid { |
| | | display: grid; |
| | | grid-template-columns: 280px 270px minmax(220px, 1fr); |
| | | grid-template-columns: 280px 270px; |
| | | column-gap: 26px; |
| | | align-items: start; |
| | | } |
| | | |
| | | .merchant-product-form-panel .el-input__wrapper, |
| | | .merchant-product-form-panel .el-select__wrapper, |
| | | .merchant-product-form-panel .el-date-editor.el-input__wrapper, |
| | | .merchant-product-form-panel .el-textarea__inner { |
| | | background: #ffffff; |
| | | } |
| | | |
| | | .product-form-row, |
| | |
| | | grid-template-columns: 54px 134px 24px; |
| | | } |
| | | |
| | | .product-form-row.amount .el-input-number { |
| | | width: 134px; |
| | | } |
| | | |
| | | .product-form-row label, |
| | | .product-static-row label, |
| | | .product-image-row label, |
| | |
| | | const productMode = ref<'list' | 'form'>('list') |
| | | const productSaving = ref(false) |
| | | const editingProductId = ref<number | string>() |
| | | const productCreatedAt = ref('') |
| | | const productUpdatedAt = ref('') |
| | | |
| | | const productPagination = reactive({ |
| | | page: 1, |
| | |
| | | |
| | | function resetProductForm(row?: Product) { |
| | | editingProductId.value = row?.id |
| | | productCreatedAt.value = formatDisplayTime(row?.createdAt || form.createdAt) |
| | | productUpdatedAt.value = formatDisplayTime(row?.submitTime || row?.createdAt || form.createdAt) |
| | | const notice = parseJsonValue<Record<string, string>>(row?.purchaseNotice, {}) |
| | | productForm.merchantId = row?.merchantId || currentMerchantId() |
| | | productForm.productType = row?.productType || 'GROUP' |
| | |
| | | <div class="product-info-middle"> |
| | | <div class="product-form-row amount"> |
| | | <label>商品金额</label> |
| | | <el-input v-model="productForm.salePrice" placeholder="请输入" /> |
| | | <el-input-number |
| | | v-model="productForm.salePrice" |
| | | :min="0.01" |
| | | :step="0.01" |
| | | :precision="2" |
| | | :controls="false" |
| | | placeholder="请输入" |
| | | /> |
| | | <span>元</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="product-info-right"> |
| | | <div class="product-static-row"> |
| | | <label>创建时间</label> |
| | | <span>{{ productCreatedAt }}</span> |
| | | </div> |
| | | <div class="product-static-row"> |
| | | <label>修改时间</label> |
| | | <span>{{ productUpdatedAt }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="product-detail-row"> |
| | |
| | | import java.util.Map; |
| | | |
| | | import jakarta.validation.constraints.DecimalMin; |
| | | import jakarta.validation.constraints.Digits; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | |
| | | String subtitle, |
| | | @NotBlank String coverUrl, |
| | | BigDecimal originalPrice, |
| | | @NotNull @DecimalMin(value = "0.01") BigDecimal salePrice, |
| | | @NotNull @DecimalMin(value = "0.01") @Digits(integer = 10, fraction = 2) BigDecimal salePrice, |
| | | BigDecimal subsidyAmount, |
| | | Integer stock, |
| | | @NotBlank String detailText, |
| | |
| | | import java.util.Map; |
| | | |
| | | import jakarta.validation.constraints.DecimalMin; |
| | | import jakarta.validation.constraints.Digits; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | |
| | | String subtitle, |
| | | @NotBlank String coverUrl, |
| | | BigDecimal originalPrice, |
| | | @NotNull @DecimalMin(value = "0.01") BigDecimal salePrice, |
| | | @NotNull @DecimalMin(value = "0.01") @Digits(integer = 10, fraction = 2) BigDecimal salePrice, |
| | | BigDecimal subsidyAmount, |
| | | Integer stock, |
| | | @NotBlank String detailText, |