|  |  |  | 
|---|
|  |  |  | <el-dialog title="积分变动记录" :visible.sync="dialogVisible" width="80%"> | 
|---|
|  |  |  | <el-bus-crud | 
|---|
|  |  |  | v-if="customerId" | 
|---|
|  |  |  | :key="customerId" | 
|---|
|  |  |  | :key="dialogId" | 
|---|
|  |  |  | :extra-query="{ customerId }" | 
|---|
|  |  |  | v-bind="recordTableConfig" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import { v4 as uuidv4 } from 'uuid' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | dialogVisible: false, | 
|---|
|  |  |  | customerId: null, | 
|---|
|  |  |  | dialogId: null, | 
|---|
|  |  |  | tableConfig: { | 
|---|
|  |  |  | url: 'flower/api/customer/point/page', | 
|---|
|  |  |  | hasNew: false, | 
|---|
|  |  |  | 
|---|
|  |  |  | columns: [ | 
|---|
|  |  |  | { label: '序号', type: 'index' }, | 
|---|
|  |  |  | { label: '用户信息', prop: 'customerName' }, | 
|---|
|  |  |  | { label: '联系方式', prop: 'customerTel' }, | 
|---|
|  |  |  | { label: '总积分', prop: 'totalPoint' }, | 
|---|
|  |  |  | { label: '已使用积分', prop: 'usedPoint' }, | 
|---|
|  |  |  | { label: '过期积分', prop: 'expiredPoint' }, | 
|---|
|  |  |  | { label: '扣减积分', formatter: (row) => row.deductionPoint ?? 0 }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | label: '剩余积分', | 
|---|
|  |  |  | formatter: (row) => | 
|---|
|  |  |  | parseInt(row.totalPoint) - | 
|---|
|  |  |  | parseInt(row.deductionPoint ?? 0) - | 
|---|
|  |  |  | parseInt(row.usedPoint) - | 
|---|
|  |  |  | parseInt(row.expiredPoint), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | searchForm: [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | type: 'row', | 
|---|
|  |  |  | items: [{ label: '用户名称', id: 'customerName', type: 'input' }], | 
|---|
|  |  |  | items: [ | 
|---|
|  |  |  | { label: '用户名称', id: 'customerName', type: 'input' }, | 
|---|
|  |  |  | { label: '联系方式', id: 'customerTel', type: 'input' }, | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | extraDialogs: [ | 
|---|
|  |  |  | 
|---|
|  |  |  | el: { | 
|---|
|  |  |  | precision: 0, | 
|---|
|  |  |  | min: 1, | 
|---|
|  |  |  | max: 99999999, | 
|---|
|  |  |  | controls: false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | rules: { | 
|---|
|  |  |  | 
|---|
|  |  |  | el: { | 
|---|
|  |  |  | precision: 0, | 
|---|
|  |  |  | min: 1, | 
|---|
|  |  |  | max: 99999999, | 
|---|
|  |  |  | controls: false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | rules: { | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | text: '积分变动记录', | 
|---|
|  |  |  | atClick: (row) => { | 
|---|
|  |  |  | this.dialogId = uuidv4() | 
|---|
|  |  |  | this.customerId = row.customerId | 
|---|
|  |  |  | this.dialogVisible = true | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | { label: '变动类型', prop: 'changeTypeStr' }, | 
|---|
|  |  |  | { label: '变动积分', prop: 'point' }, | 
|---|
|  |  |  | { label: '变动原因', prop: 'typeStr' }, | 
|---|
|  |  |  | { label: '变动时间', prop: 'recordDate' }, | 
|---|
|  |  |  | { label: '变动时间', prop: 'createTime' }, | 
|---|
|  |  |  | { label: '备注', prop: 'remarks' }, | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | searchFormAttrs: { | 
|---|
|  |  |  | 
|---|
|  |  |  | span: 24, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | label: '变动时间:', | 
|---|
|  |  |  | id: 'createTimeStartStr', | 
|---|
|  |  |  | component: 'el-bus-date-range', | 
|---|
|  |  |  | el: { | 
|---|
|  |  |  | type: 'datetime', | 
|---|
|  |  |  | format: 'yyyy-MM-dd HH:mm:ss', | 
|---|
|  |  |  | valueFormat: 'yyyy-MM-dd HH:mm:ss', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | commonFormat: true, | 
|---|
|  |  |  | commonFormatProps: ['createTimeStartStr', 'createTimeEndStr'], | 
|---|
|  |  |  | searchImmediately: true, | 
|---|
|  |  |  | span: 24, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | label: '备注:', | 
|---|
|  |  |  | id: 'remarks', | 
|---|
|  |  |  | type: 'input', | 
|---|