Commit 41772c96 by linjinhong

充值页面添加筛选字段

parent c13659c9
...@@ -3,3 +3,6 @@ import axios from '../axios' ...@@ -3,3 +3,6 @@ import axios from '../axios'
export function getUserRechargeRecordListApi(params) { export function getUserRechargeRecordListApi(params) {
return axios.post('/pay/businessPayRecord/list_page', params) return axios.post('/pay/businessPayRecord/list_page', params)
} }
export function getSubjectListApi(params) {
return axios.get('/pay/businessPayRecord/subjectList', params)
}
...@@ -9,10 +9,25 @@ ...@@ -9,10 +9,25 @@
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="套餐版本"> <el-form-item label="套餐版本">
<el-input <el-select
v-model="searchForm.subject" v-model="searchForm.subject"
placeholder="请输入客户" placeholder="请选择套餐版本"
clearable></el-input> clearable>
<el-option
v-for="(item, index) in subjectList"
:key="index"
:label="item.value"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="支付状态">
<el-select
v-model="searchForm.payStatus"
placeholder="请选择支付状态"
clearable>
<el-option label="已支付" value="已支付"></el-option>
<el-option label="待支付" value="待支付"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="交易号"> <el-form-item label="交易号">
<el-input <el-input
...@@ -32,6 +47,17 @@ ...@@ -32,6 +47,17 @@
placeholder="请输入业务类型" placeholder="请输入业务类型"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="付款时间">
<el-date-picker
:default-time="['00:00:00', '23:59:59']"
v-model="searchForm.daterange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
:confirm="false"
start-placeholder="初始创建时间"
end-placeholder="结束创建时间"></el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
...@@ -51,6 +77,7 @@ ...@@ -51,6 +77,7 @@
width="100%" width="100%"
height="100%" height="100%"
:highlight-current-row="true" :highlight-current-row="true"
@sort-change="sortChange"
header-row-class-name="header-row-class-name"> header-row-class-name="header-row-class-name">
<el-table-column <el-table-column
label="序号" label="序号"
...@@ -104,6 +131,13 @@ ...@@ -104,6 +131,13 @@
width="100" width="100"
:show-overflow-tooltip="true"></el-table-column> :show-overflow-tooltip="true"></el-table-column>
<el-table-column <el-table-column
label="支付状态"
prop="payStatus"
header-align="center"
align="center"
width="100"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="业务类型" label="业务类型"
prop="businessType" prop="businessType"
header-align="center" header-align="center"
...@@ -149,6 +183,7 @@ ...@@ -149,6 +183,7 @@
<el-table-column <el-table-column
label="付款时间" label="付款时间"
sortable="custom"
prop="clientTime" prop="clientTime"
header-align="center" header-align="center"
align="center" align="center"
...@@ -183,13 +218,18 @@ ...@@ -183,13 +218,18 @@
</div> </div>
</template> </template>
<script> <script>
import { getUserRechargeRecordListApi } from '@/common/api/user/user' import {
getUserRechargeRecordListApi,
getSubjectListApi
} from '@/common/api/user/user'
export default { export default {
name: 'rechargeRecord', name: 'rechargeRecord',
data() { data() {
return { return {
period: [], period: [],
subjectList: [],
sortParmas: {},
searchForm: {}, searchForm: {},
total: 0, total: 0,
pageSize: 50, pageSize: 50,
...@@ -200,14 +240,22 @@ export default { ...@@ -200,14 +240,22 @@ export default {
}, },
async created() { async created() {
this.loadData() this.loadData()
this.getSubjectList()
}, },
methods: { methods: {
async loadData() { async loadData(obj) {
const data = { let data = {
...this.searchForm, ...this.searchForm,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize
} }
if (this.searchForm.daterange?.length) {
data.minTime = this.searchForm.daterange[0]
data.maxTime = this.searchForm.daterange[1]
}
if (obj) {
data = { ...data, ...obj }
}
this.loading = true this.loading = true
try { try {
const res = await getUserRechargeRecordListApi(data) const res = await getUserRechargeRecordListApi(data)
...@@ -215,22 +263,37 @@ export default { ...@@ -215,22 +263,37 @@ export default {
this.rechargeRecordList = res.data.records this.rechargeRecordList = res.data.records
this.total = res.data.total this.total = res.data.total
} catch (e) { } catch (e) {
console.error(e) console.log(e)
} finally { } finally {
this.loading = false this.loading = false
} }
}, },
search() { search() {
this.currentPage = 1 this.currentPage = 1
this.loadData() this.loadData(this.sortParmas)
}, },
onCurrentChange(currentPage) { onCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.loadData() this.loadData(this.sortParmas)
}, },
sizeChange(pageSize) { sizeChange(pageSize) {
this.pageSize = pageSize this.pageSize = pageSize
this.loadData() this.loadData(this.sortParmas)
},
sortChange({ column, prop, order }) {
this.sortParmas = {
field: prop,
asc: order === 'ascending'
}
this.loadData(this.sortParmas)
},
async getSubjectList() {
try {
const { data } = await getSubjectListApi()
this.subjectList = data
} catch (error) {
console.log(error)
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment