分类表格文字修改
积分优惠券限制库存为0不能发布
删除用户优惠券选择用户弹窗中的新增按钮
优惠券使用条件和面值校验问题
|  |  |  | 
|---|
|  |  |  | tableConfig: { | 
|---|
|  |  |  | url: 'flower/api/customer/page', | 
|---|
|  |  |  | saveQuery: false, | 
|---|
|  |  |  | hasNew: false, | 
|---|
|  |  |  | hasEdit: false, | 
|---|
|  |  |  | hasDelete: false, | 
|---|
|  |  |  | hasView: false, | 
|---|
|  |  |  | 
|---|
|  |  |  | ), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { label: '排序', prop: 'sortBy' }, | 
|---|
|  |  |  | { label: '下级数量', formatter: (row) => row.childrenCount }, | 
|---|
|  |  |  | { label: '品种数量', formatter: (row) => row.childrenCount }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | label: '是否显示', | 
|---|
|  |  |  | formatter: (row) => ( | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | text: '上架', | 
|---|
|  |  |  | show: (row) => | 
|---|
|  |  |  | row.status === 'inactive' || row.status === 'expired', | 
|---|
|  |  |  | (row.status === 'inactive' || row.status === 'expired') && | 
|---|
|  |  |  | row.couponAmount > 0, | 
|---|
|  |  |  | atClick: async (row) => { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | await this.$elBusUtil.confirm('确定要上架吗?') | 
|---|
|  |  |  | 
|---|
|  |  |  | obj.elBusForm | 
|---|
|  |  |  | .getComponentById('minOrderAmount') | 
|---|
|  |  |  | .$parent.clearValidate() | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | updateForm({ minOrderAmount: undefined }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | label: '优惠券使用条件:', | 
|---|
|  |  |  | id: 'minOrderAmount', | 
|---|
|  |  |  | type: 'input-number', | 
|---|
|  |  |  | el: { | 
|---|
|  |  |  | min: 0, | 
|---|
|  |  |  | el: (row) => ({ | 
|---|
|  |  |  | min: row.couponDiscountType === 'discount' ? 0.01 : 0, | 
|---|
|  |  |  | max: 99999999, | 
|---|
|  |  |  | precision: 2, | 
|---|
|  |  |  | controls: false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }), | 
|---|
|  |  |  | prefix: '满', | 
|---|
|  |  |  | unit: '元', | 
|---|
|  |  |  | rules: { | 
|---|
|  |  |  | 
|---|
|  |  |  | controls: false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | unit: '元', | 
|---|
|  |  |  | rules: { | 
|---|
|  |  |  | required: true, | 
|---|
|  |  |  | message: '请输入优惠券面值', | 
|---|
|  |  |  | trigger: 'blur', | 
|---|
|  |  |  | rules: (row) => { | 
|---|
|  |  |  | return [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | required: true, | 
|---|
|  |  |  | message: '请输入优惠券面值', | 
|---|
|  |  |  | trigger: 'blur', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | validator: (rule, value, callback) => { | 
|---|
|  |  |  | if (value && row.minOrderAmount && value > row.minOrderAmount) { | 
|---|
|  |  |  | callback(new Error('优惠券面值不能大于优惠券使用条件')) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | callback() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | trigger: 'blur', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ] | 
|---|