|
|
@@ -2,7 +2,14 @@
|
|
|
<template>
|
|
|
<app-view>
|
|
|
<template #header>
|
|
|
- <app-filter :options="filterOptons" />
|
|
|
+ <app-filter :option="filterOption">
|
|
|
+ <template #after>
|
|
|
+ <el-form-item label="交易日" prop="date">
|
|
|
+ <el-date-picker type="daterange" v-model="dateValue" value-format="YYYYMMDD"
|
|
|
+ start-placeholder="开始" end-placeholder="结束" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </app-filter>
|
|
|
</template>
|
|
|
<app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
|
<!-- 操作 -->
|
|
|
@@ -26,23 +33,29 @@ import { ElMessage } from 'element-plus'
|
|
|
import { formatDate } from '@/filters'
|
|
|
import { useEnum } from '@/hooks/enum'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
-import { useDataFilter } from '@/hooks/datatable'
|
|
|
+import { useDataFilter } from '@/hooks/datatable-v2'
|
|
|
import { useOperation } from '@/hooks/operation'
|
|
|
import { queryPutOrIn } from '@/services/api/account'
|
|
|
+import { getAllBankCus } from '@/services/api/bank'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
-import AppFilter from '@pc/components/base/table-filter/index.vue'
|
|
|
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
|
|
|
import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
|
|
|
const executetypeEnum = useEnum('executetype') // 类型
|
|
|
const applystatusEnum = useEnum('applystatus') // 状态
|
|
|
+const usertype2Enum = useEnum('usertype2') // 账户类型
|
|
|
|
|
|
-const { filterOptons, getQueryParams } = useDataFilter<Model.PutOrInReq>()
|
|
|
+const dateValue = shallowRef<string[] | null>([])
|
|
|
+
|
|
|
+const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.PutOrInReq>()
|
|
|
|
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.PutOrInRsp>({
|
|
|
onClose: () => onSearch()
|
|
|
})
|
|
|
|
|
|
+const { dataList: bankList } = useRequest(getAllBankCus)
|
|
|
+
|
|
|
const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryPutOrIn, {
|
|
|
manual: true,
|
|
|
params: {
|
|
|
@@ -57,7 +70,7 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryP
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ field: 'accountcode', label: '资金账户' },
|
|
|
{ field: 'accountname', label: '用户/机构' },
|
|
|
- { field: 'usertype', label: '账户类型' },
|
|
|
+ { field: 'usertype', label: '账户类型', formatValue: (val) => usertype2Enum.getEnumTypeName(val) },
|
|
|
{ field: 'parentaccountname', label: '所属机构' },
|
|
|
{ field: 'cusbankname', label: '托管银行' },
|
|
|
{ field: 'tradedate', label: '交易日' },
|
|
|
@@ -70,42 +83,60 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ field: 'operate', label: '操作', fixed: 'right' }
|
|
|
])
|
|
|
|
|
|
-filterOptons.selectList = [
|
|
|
+filterOption.items = [
|
|
|
{
|
|
|
key: 'executetype',
|
|
|
label: '类型',
|
|
|
- options: () => executetypeEnum.getEnumOptions(),
|
|
|
+ options: () => executetypeEnum.getEnumOptions()
|
|
|
},
|
|
|
{
|
|
|
key: 'applystatus',
|
|
|
label: '状态',
|
|
|
- options: () => [],
|
|
|
+ options: () => applystatusEnum.getEnumOptions()
|
|
|
},
|
|
|
{
|
|
|
key: 'cusbankid',
|
|
|
label: '托管银行',
|
|
|
- options: () => [],
|
|
|
+ options: () => bankList.value.map((e) => ({
|
|
|
+ label: e.cusbankname,
|
|
|
+ value: e.cusbankid
|
|
|
+ }))
|
|
|
},
|
|
|
{
|
|
|
key: 'usertype',
|
|
|
label: '账户类型',
|
|
|
- options: () => [],
|
|
|
+ options: () => usertype2Enum.getEnumOptions()
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '登录账号',
|
|
|
+ key: 'loginid'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '资金账户',
|
|
|
+ key: 'accountcode'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '交易商',
|
|
|
+ key: 'accountname',
|
|
|
+ placeholder: '输入交易商ID',
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-filterOptons.inputList = [
|
|
|
- { label: '登录账号', keys: ['loginid'] },
|
|
|
- { label: '资金账户', keys: ['accountcode'] },
|
|
|
- { label: '交易商', keys: ['accountname'] },
|
|
|
-]
|
|
|
-
|
|
|
-filterOptons.buttonList = [
|
|
|
- { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
- { lable: '重置', className: 'el-button--primary', onClick: () => onSearch(true) }
|
|
|
+filterOption.buttons = [
|
|
|
+ { label: '查询', className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
|
|
|
+ { label: '重置', className: 'el-button--primary', onClick: () => onReset() }
|
|
|
]
|
|
|
|
|
|
-const onSearch = (clear = false) => {
|
|
|
- const qs = getQueryParams(clear)
|
|
|
+const onSearch = () => {
|
|
|
+ const qs = getQueryParams()
|
|
|
+ const [startDate, endDate] = dateValue.value || []
|
|
|
+ qs.tradedatestart = startDate
|
|
|
+ qs.tradedateend = endDate
|
|
|
run(qs)
|
|
|
}
|
|
|
+
|
|
|
+const onReset = () => {
|
|
|
+ dateValue.value = []
|
|
|
+ resetFilters()
|
|
|
+}
|
|
|
</script>
|