fix: 模块增加时间查询功能。

This commit is contained in:
tianyongbao
2024-05-08 11:19:52 +08:00
parent 63aa9fe123
commit cd9a94f73f
8 changed files with 131 additions and 17 deletions

View File

@@ -23,6 +23,9 @@
<el-option v-for="dict in deal_category" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="交易时间" prop="time">
<el-date-picker v-model="queryParams.time" type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" />
</el-form-item>
</el-form>
<div class="search-btn-con">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@@ -125,8 +128,10 @@ import {
} from '@/api/invest/accountDealRecord'
// eslint-disable-next-line no-unused-vars
import { listAccounts } from '@/api/invest/accounts'
import dayjs from 'dayjs'
import { require } from '@/utils/require'
const { proxy } = getCurrentInstance()
const { deal_type, account_type, deal_category } = proxy.useDict('deal_type', 'account_type', 'deal_category')
const accountDealRecordList = ref([])
@@ -152,6 +157,7 @@ const data = reactive({
pageSize: 10,
name: null,
type: null,
time: '',
accountId: null,
dealType: null,
dealCategory: null
@@ -212,6 +218,15 @@ function getAddAccountList() {
/** 查询账户交易记录列表 */
function getList() {
loading.value = true
const timeRange = queryParams.value.time
let st = ''
let et = ''
if (timeRange && timeRange.length === 2) {
st = dayjs(timeRange[0]).format('YYYY-MM-DD')
et = dayjs(timeRange[1]).format('YYYY-MM-DD')
}
queryParams.value.startTime = st
queryParams.value.endTime = et
listAccountDealRecord(queryParams.value).then((response) => {
accountDealRecordList.value = response.rows
total.value = response.total