| | |
| | | <template> |
| | | <el-bus-crud v-bind="tableConfig" /> |
| | | <el-bus-crud ref="crud" v-bind="tableConfig" /> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | }, |
| | | ...couponColumn(), |
| | | { label: '状态', prop: 'statusName', minWidth: 120 }, |
| | | { label: '库存', prop: 'couponAmount', minWidth: 120 }, |
| | | { label: '发放数量', prop: 'couponAmount', minWidth: 120 }, |
| | | { label: '已兑换', prop: 'getNum', minWidth: 120 }, |
| | | { label: '库存', prop: 'unGetNum', minWidth: 120 }, |
| | | { label: '所需积分', prop: 'point', minWidth: 120 }, |
| | | ], |
| | | searchForm: [ |
| | |
| | | el: { |
| | | inputAttrs: { |
| | | min: 1, |
| | | max: 99999999, |
| | | precision: 0, |
| | | controls: false, |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | label: '库存:', |
| | | label: '发放数量:', |
| | | id: 'couponAmount', |
| | | type: 'input-number', |
| | | el: { |
| | | precision: 0, |
| | | min: 0, |
| | | max: 99999999, |
| | | controls: false, |
| | | }, |
| | | rules: { required: true, message: '请输入库存', trigger: 'blur' }, |
| | | rules: [ |
| | | { required: true, message: '请输入发放数量', trigger: 'blur' }, |
| | | { |
| | | type: 'number', |
| | | min: 1, |
| | | message: '发放数量必须大于0', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '积分数量:', |
| | |
| | | el: { |
| | | precision: 0, |
| | | min: 1, |
| | | max: 99999999, |
| | | controls: false, |
| | | }, |
| | | rules: { |
| | |
| | | { |
| | | 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('确定要上架吗?') |
| | |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success('上架成功') |
| | | this.$refs.crud.clearSelection() |
| | | } |
| | | } catch (e) { |
| | | return false |
| | |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success('下架成功') |
| | | this.$refs.crud.clearSelection() |
| | | } |
| | | } catch (e) { |
| | | return false |