Commit c24aa616 by 前端

更新联调后代码

1 parent d6b355bb
...@@ -125,4 +125,22 @@ export default { ...@@ -125,4 +125,22 @@ export default {
data: params data: params
}) })
}, },
// 提现记录分页列表
getRedEnvelopeWithdraw (params) {
params.method = 'marketing.api.activityRedEnvelope.cash.out.record.page'
return http({
url,
data: params
})
},
exportRedEnvelopeWithdraw (params) {
params.method = 'marketing.api.activityRedEnvelope.cash.out.record.export'
return http({
url,
data: params
})
},
} }
<template>
<div>
<div class="input-number-range" :class="{ 'is-disabled': disabled }">
<div class="flex">
<div class="from">
<el-input
ref="input_from"
v-model="formData[keyObj.from]"
:disabled="disabled"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
placeholder=""
@input="handleInputChangeFrom"
></el-input>
</div>
<div class="center">
<span>至</span>
</div>
<div class="to">
<el-input
ref="input_to"
v-model="formData[keyObj.to]"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
:disabled="disabled"
placeholder=""
@input="handleInputChangeTo"
></el-input>
</div>
<div class="unit">
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'InputNumberRange',
props: {
// 是否禁用
disabled: {
type: Boolean,
default: false
},
formData:{
type: Object,
default: ()=>{
return {}
}
},
keyObj:{
type: Object,
default: ()=>{
return {
from: 'a',
to: 'b'
}
}
},
},
data() {
return {
}
},
methods: {
// from输入框change事件
handleInputChangeFrom(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
// to输入框change事件
handleInputChangeTo(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
}
}
</script>
<style lang="scss" scoped>
.input-number-range {
background-color: #fff;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
.flex {
display: flex;
flex-direction: row;
width: 100%;
justify-content: center;
align-items: center;
/deep/ .el-input .el-input__inner {
border: 0px;
margin: 0;
padding: 0 10px;
background-color: transparent;
}
.center {
margin-top: 1px;
color: #666;
}
.unit{
margin-right: 10px;
color: #666;
}
}
.is-disabled {
background-color: #eef0f6;
border-color: #e4e7ed;
color: #c0c4cc;
cursor: not-allowed;
}
</style>
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
type="default" type="default"
plain plain
@click="showImportRecord = true" @click="showImportRecord = true"
>导入记录</el-button> >导入记录
</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
<GLTable <GLTable
ref="listRef" ref="listRef"
:getListApi="getListApi" :getListApi="getListApi"
:searchForm="searchForm" :searchForm="tableSearchForm"
:noDataImg="url" :noDataImg="url"
:tableParams="tableParams" :tableParams="tableParams"
:pageConf="pageConf" :pageConf="pageConf"
...@@ -49,13 +50,14 @@ ...@@ -49,13 +50,14 @@
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import importRecord from './importRecord.vue' import importRecord from './importRecord.vue'
export default { export default {
name: 'RedEnvelopeConfig', name: 'RedEnvelopeConfig',
components: { importRecord }, components: {importRecord},
data () { data() {
return { return {
url, url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: { searchForm: {
merchantName: '', merchantName: '',
merchantId: '', merchantId: '',
...@@ -88,8 +90,9 @@ export default { ...@@ -88,8 +90,9 @@ export default {
}, },
{ {
label: '展示时间', label: '展示时间',
name: 'createDate', name: 'showTime',
type: 'datePicker', type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true, isClear: true,
customPickerOptions: { customPickerOptions: {
disabledDate(date) { disabledDate(date) {
...@@ -103,8 +106,9 @@ export default { ...@@ -103,8 +106,9 @@ export default {
}, },
{ {
label: '抽奖时间', label: '抽奖时间',
name: 'createDate', name: 'lotteryDrawTime',
type: 'datePicker', type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true, isClear: true,
customPickerOptions: { customPickerOptions: {
disabledDate(date) { disabledDate(date) {
...@@ -153,7 +157,7 @@ export default { ...@@ -153,7 +157,7 @@ export default {
minWidth: 100, minWidth: 100,
formatter: cell => { formatter: cell => {
// 0:随机红包;1:九宫格;2:翻牌;3:大转盘; // 0:随机红包;1:九宫格;2:翻牌;3:大转盘;
return { 0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[cell.activityType] return {0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘'}[cell.activityType]
} }
}, },
// { // {
...@@ -163,12 +167,12 @@ export default { ...@@ -163,12 +167,12 @@ export default {
// }, // },
{ {
label: '展示时间', label: '展示时间',
prop: '', prop: 'showTime',
minWidth: 150 minWidth: 150
}, },
{ {
label: '抽奖时间', label: '抽奖时间',
prop: '', prop: 'lotteryDrawTime',
minWidth: 150 minWidth: 150
}, },
{ {
...@@ -183,19 +187,41 @@ export default { ...@@ -183,19 +187,41 @@ export default {
}, },
] ]
}, },
showImportRecord: false showImportRecord: false,
tableSearchForm: {}
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
handleSearch () { handleSearch() {
this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable() this.$refs.listRef.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch() this.handleSearch()
}, },
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime');
this.updateParams(params, 'lotteryDrawTime', 'lotteryDrawTime', 'startLotteryDrawTime', 'endLotteryDrawTime');
return params
},
updateParams(params, paramKey, formKey, beginKey, endKey) {
if (params[paramKey]) {
params[beginKey] = this.searchForm[formKey][0];
params[endKey] = this.searchForm[formKey][1];
delete params[paramKey];
} else {
delete params[beginKey];
delete params[endKey];
}
// delete params[paramKey];
return params
}
} }
} }
</script> </script>
...@@ -207,25 +233,31 @@ export default { ...@@ -207,25 +233,31 @@ export default {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
padding: 20px; padding: 20px;
.table-title { .table-title {
font-weight: 700; font-weight: 700;
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
padding-bottom: 18px; padding-bottom: 18px;
} }
.sticky { .sticky {
position: relative; position: relative;
z-index: 2; z-index: 2;
&-btns { &-btns {
position: absolute; position: absolute;
right: 0; right: 0;
bottom: -23px; bottom: -23px;
overflow: hidden; overflow: hidden;
.el-button + .el-button { .el-button + .el-button {
margin-left: 8px; margin-left: 8px;
} }
.btns { .btns {
transition: all 0.25s; transition: all 0.25s;
.el-button { .el-button {
padding: 8px 15px; padding: 8px 15px;
min-width: 60px; min-width: 60px;
......
...@@ -8,18 +8,25 @@ ...@@ -8,18 +8,25 @@
:formData="searchFormData" :formData="searchFormData"
@handleOk="handleSearch" @handleOk="handleSearch"
@handleRest="handleReset" @handleRest="handleReset"
></GLCombiForm> >
<div slot="thirdCashOutMoneySlot">
<inputNumRange :formData="searchForm"
:keyObj="{from: 'startThirdCashOutMoney', to:'endThirdCashOutMoney'}"></inputNumRange>
</div>
</GLCombiForm>
<div class="sticky-btns"> <div class="sticky-btns">
<div class="btns"> <div class="btns">
<el-button <el-button
type="default" type="default"
plain plain
@click="showImportRecord = true" @click="showImportRecord = true"
>导入记录</el-button> >导入记录
</el-button>
<el-button <el-button
@click="handleExport" @click="handleExport"
>导出</el-button> >导出
</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -28,7 +35,7 @@ ...@@ -28,7 +35,7 @@
<GLTable <GLTable
ref="listRef" ref="listRef"
:getListApi="getListApi" :getListApi="getListApi"
:searchForm="searchForm" :searchForm="tableSearchForm"
:noDataImg="url" :noDataImg="url"
:tableParams="tableParams" :tableParams="tableParams"
:pageConf="pageConf" :pageConf="pageConf"
...@@ -53,32 +60,56 @@ ...@@ -53,32 +60,56 @@
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import importRecord from './importRecord.vue' import importRecord from './importRecord.vue'
import { exportFn } from '@/common/constant' import {exportFn} from '@/common/constant'
import inputNumRange from '@/components/inputNumRange'
export default { export default {
name: 'RedEnvelopeWithdraw', name: 'RedEnvelopeWithdraw',
components: { importRecord }, components: {importRecord, inputNumRange},
data () { data() {
return { return {
url, url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: { searchForm: {},
merchantName: '',
merchantId: '',
staffName: ''
},
searchFormData: [ searchFormData: [
{ {
label: '流水号', label: '流水号',
name: 'activityName', name: 'thirdSerialNumber',
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
}, },
{ {
label: '提现状态', label: '提现状态',
name: 'merchantName', name: 'thirdCashOutStatus',
type: 'input', type: 'select',
maxlength: 100 optionLabel: 'optionLabel',
optionId: 'optionId',
optionList: [
{
optionLabel: '全部',
optionId: null
},
{
optionLabel: '提现成功',
optionId: '提现成功'
},
{
optionLabel: '提现失败',
optionId: '提现失败'
},
{
optionLabel: '补发成功',
optionId: '补发成功'
},
{
optionLabel: '补发失败',
optionId: '补发失败'
},
{
optionLabel: '发放中',
optionId: '发放中'
}
]
}, },
{ {
label: '微信昵称', label: '微信昵称',
...@@ -88,14 +119,15 @@ export default { ...@@ -88,14 +119,15 @@ export default {
}, },
{ {
label: '提现金额/元', label: '提现金额/元',
name: 'userPhone', addHtml: 'thirdCashOutMoneySlot',
type: 'input' // type: 'input'
}, },
{ {
label: '提现时间', label: '提现时间',
name: 'createDate', name: 'thirdCashOutTime',
type: 'datePicker', type: 'datePicker',
isClear: true, isClear: true,
valueFormat: 'yyyy-MM-dd',
customPickerOptions: { customPickerOptions: {
disabledDate(date) { disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate())) const yesterday = new Date(new Date().setDate(new Date().getDate()))
...@@ -107,7 +139,7 @@ export default { ...@@ -107,7 +139,7 @@ export default {
} }
} }
], ],
getListApi: this.$apis.redenvelope.getRedEnvelopeRecordList, getListApi: this.$apis.redenvelope.getRedEnvelopeWithdraw,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: false, tableOption: false,
...@@ -124,49 +156,71 @@ export default { ...@@ -124,49 +156,71 @@ export default {
}, },
{ {
label: '流水号', label: '流水号',
prop: 'activityName', prop: 'thirdSerialNumber',
minWidth: 100 minWidth: 100
}, },
{ {
label: '提现金额/元', label: '提现金额/元',
prop: 'thirdCashOutMoney',
minWidth: 100, minWidth: 100,
formatter: cell => `${cell.merchantId}/${cell.merchantName}` // formatter: cell => `${cell.merchantId}/${cell.merchantName}`
}, },
{ {
label: '提现状态', label: '提现状态',
minWidth: 100, minWidth: 100,
formatter: cell => `${cell.merchantId}/${cell.merchantName}` prop: 'thirdCashOutStatus'
}, },
{ {
label: '提现时间', label: '提现时间',
minWidth: 150, minWidth: 150,
formatter: cell => `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')}` prop: 'thirdCashOutTime',
// formatter: cell => `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')}`
}, },
{ {
label: '备注', label: '备注',
prop: 'thirdPrizeMoney', prop: 'thirdCashOutRemark',
minWidth: 100 minWidth: 100
}, },
] ]
}, },
showImportRecord: false showImportRecord: false,
tableSearchForm: {}
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
handleSearch () { handleSearch() {
this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable() this.$refs.listRef.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch() this.handleSearch()
}, },
handleExport () { updateParams(params, paramKey, formKey, beginKey, endKey) {
// var params = this.$options.data.call(this).searchForm if (params[paramKey]) {
// this.$apis.redenvelope.exportGoodsApi(params).then(res => { params[beginKey] = this.searchForm[formKey][0];
// exportFn(res) params[endKey] = this.searchForm[formKey][1];
// }) } else {
delete params[beginKey];
delete params[endKey];
}
delete params[paramKey];
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'thirdCashOutTime', 'thirdCashOutTime', 'startThirdCashOutTime', 'endThirdCashOutTime');
params.startThirdCashOutMoney ? params.startThirdCashOutMoney *= 100 : ' '
params.endThirdCashOutMoney ? params.endThirdCashOutMoney *= 100 : ''
return params
},
handleExport() {
const params = this.getParams()
this.$apis.redenvelope.exportRedEnvelopeWithdraw(params).then(res => {
exportFn(res)
})
}, },
} }
} }
...@@ -179,25 +233,31 @@ export default { ...@@ -179,25 +233,31 @@ export default {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
padding: 20px; padding: 20px;
.table-title { .table-title {
font-weight: 700; font-weight: 700;
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
padding-bottom: 18px; padding-bottom: 18px;
} }
.sticky { .sticky {
position: relative; position: relative;
z-index: 2; z-index: 2;
&-btns { &-btns {
position: absolute; position: absolute;
right: 0; right: 0;
bottom: -23px; bottom: -23px;
overflow: hidden; overflow: hidden;
.el-button + .el-button { .el-button + .el-button {
margin-left: 8px; margin-left: 8px;
} }
.btns { .btns {
transition: all 0.25s; transition: all 0.25s;
.el-button { .el-button {
padding: 8px 15px; padding: 8px 15px;
min-width: 60px; min-width: 60px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!