|
@@ -2,7 +2,73 @@
|
|
|
<template>
|
|
<template>
|
|
|
<app-view>
|
|
<app-view>
|
|
|
<template #header>
|
|
<template #header>
|
|
|
- <app-filter :options="filterOptons" />
|
|
|
|
|
|
|
+ <el-form ref="formRef" class="el-form--filter" :model="queryParams" :rules="formRules"
|
|
|
|
|
+ :show-message="false">
|
|
|
|
|
+ <el-form-item label="市场" prop="marketId">
|
|
|
|
|
+ <el-select v-model="queryParams.marketId">
|
|
|
|
|
+ <template v-for="item in getMarketOptions([15, 97, 99], true)" :key="item.value">
|
|
|
|
|
+ <el-option :label="item.label" :value="item.value" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="查询类型" prop="isHis">
|
|
|
|
|
+ <el-select v-model="queryParams.isHis" @change="onTypeChange">
|
|
|
|
|
+ <el-option label="当前" :value="0" />
|
|
|
|
|
+ <el-option label="历史" :value="1" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="日期" prop="date" v-if="queryParams.isHis === 1">
|
|
|
|
|
+ <el-date-picker type="daterange" v-model="dateValue" value-format="YYYY-MM-DD"
|
|
|
|
|
+ start-placeholder="开始" end-placeholder="结束" @change="onDateChange" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="方向" prop="buyOrSell">
|
|
|
|
|
+ <el-select v-model="queryParams.buyOrSell" clearable>
|
|
|
|
|
+ <template v-for="item in getBuyOrSellList()" :key="item.value">
|
|
|
|
|
+ <el-option :label="item.label" :value="item.value" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="类型" prop="buildType">
|
|
|
|
|
+ <el-select v-model="queryParams.buildType" clearable>
|
|
|
|
|
+ <template v-for="item in buildtypeEnum.getEnumOptions()" :key="item.value">
|
|
|
|
|
+ <el-option :label="item.label" :value="item.value" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="成交类别" prop="tradeTypes">
|
|
|
|
|
+ <el-select v-model="queryParams.tradeTypes" clearable>
|
|
|
|
|
+ <el-option label="交易成交" value="1,2,10" />
|
|
|
|
|
+ <el-option label="交收成交" value="3,4" />
|
|
|
|
|
+ <el-option label="风控斩仓" value="6" />
|
|
|
|
|
+ <el-option label="协议成交" value="7,9,11" />
|
|
|
|
|
+ <el-option label="持仓过户" value="29" />
|
|
|
|
|
+ <el-option label="系统强平" value="12" />
|
|
|
|
|
+ <el-option label="其他成交" value="5,8,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="手续费" prop="feeSearchType">
|
|
|
|
|
+ <el-select v-model="queryParams.feeSearchType" clearable>
|
|
|
|
|
+ <el-option label="等于0" :value="1" />
|
|
|
|
|
+ <el-option label="不等于0" :value="2" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="成交单号" prop="tradeId">
|
|
|
|
|
+ <el-input type="number" v-model="queryParams.tradeId" placeholder="请输入" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="商品" prop="goodsId">
|
|
|
|
|
+ <el-input type="number" v-model="queryParams.goodsId" placeholder="请输入商品ID" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="账户" prop="accountId">
|
|
|
|
|
+ <el-input type="number" v-model="queryParams.accountId" placeholder="请输入账户ID" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="所属机构" prop="areaUserName">
|
|
|
|
|
+ <el-input v-model="queryParams.areaUserName" placeholder="请输入代码或名称" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" @click="onSearch(false)">查询</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="onSearch(true)">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
</template>
|
|
</template>
|
|
|
<app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
<app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
|
<template #headerLeft>
|
|
<template #headerLeft>
|
|
@@ -25,26 +91,29 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
|
|
|
|
+import { ref } from 'vue'
|
|
|
|
|
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
import { formatDate } from '@/filters'
|
|
import { formatDate } from '@/filters'
|
|
|
import { getBuyOrSellList, getBuyOrSellName } from '@/constants/order'
|
|
import { getBuyOrSellList, getBuyOrSellName } from '@/constants/order'
|
|
|
import { useEnum } from '@/hooks/enum'
|
|
import { useEnum } from '@/hooks/enum'
|
|
|
import { useMarket } from '@/hooks/market'
|
|
import { useMarket } from '@/hooks/market'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
|
-import { useDataFilter } from '@/hooks/datatable'
|
|
|
|
|
import { useOperation } from '@/hooks/operation'
|
|
import { useOperation } from '@/hooks/operation'
|
|
|
import { queryContractSheet } from '@/services/api/order'
|
|
import { queryContractSheet } from '@/services/api/order'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
-import AppFilter from '@pc/components/base/table-filter/index.vue'
|
|
|
|
|
import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
import AppOperation from '@pc/components/base/operation/index.vue'
|
|
import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
|
|
|
|
|
const { getMarketOptions } = useMarket()
|
|
const { getMarketOptions } = useMarket()
|
|
|
const buildtypeEnum = useEnum('buildtype') // 单据类型
|
|
const buildtypeEnum = useEnum('buildtype') // 单据类型
|
|
|
-const queryParams = shallowRef<Model.ContractSheetReq>()
|
|
|
|
|
|
|
+const tradetypeEnum = useEnum('tradetype') // 成交类别
|
|
|
|
|
|
|
|
-const { filterOptons, getQueryParams } = useDataFilter<Model.ContractSheetReq>()
|
|
|
|
|
|
|
+const formRef = ref<FormInstance>()
|
|
|
|
|
+const dateValue = ref<string[]>([])
|
|
|
|
|
+
|
|
|
|
|
+const queryParams = ref<Partial<Model.ContractSheetReq>>({
|
|
|
|
|
+ isHis: 0
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.ContractSheetRsp>({
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.ContractSheetRsp>({
|
|
|
onClose: () => onSearch()
|
|
onClose: () => onSearch()
|
|
@@ -55,11 +124,13 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryC
|
|
|
params: {
|
|
params: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
|
- isHis: 0,
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ onError: (err) => {
|
|
|
|
|
+ ElMessage.error(err)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
|
|
|
|
+const tableColumns = ref<Model.TableColumn[]>([
|
|
|
{ field: 'tradeid', label: '成交单号' },
|
|
{ field: 'tradeid', label: '成交单号' },
|
|
|
{ field: 'loginid', label: '登录账号' },
|
|
{ field: 'loginid', label: '登录账号' },
|
|
|
{ field: 'accountid', label: '资金账户' },
|
|
{ field: 'accountid', label: '资金账户' },
|
|
@@ -68,7 +139,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ field: 'goodsCodeName', label: '商品代码/名称' },
|
|
{ field: 'goodsCodeName', label: '商品代码/名称' },
|
|
|
{ field: 'buyorsell', label: '方向', formatValue: (val) => getBuyOrSellName(val) },
|
|
{ field: 'buyorsell', label: '方向', formatValue: (val) => getBuyOrSellName(val) },
|
|
|
{ field: 'buildtype', label: '类型', formatValue: (val) => buildtypeEnum.getEnumTypeName(val) },
|
|
{ field: 'buildtype', label: '类型', formatValue: (val) => buildtypeEnum.getEnumTypeName(val) },
|
|
|
- { field: 'tradetype', label: '成交类别' },
|
|
|
|
|
|
|
+ { field: 'tradetype', label: '成交类别', formatValue: (val) => tradetypeEnum.getEnumTypeName(val) },
|
|
|
{ field: 'tradeprice', label: '成交价格' },
|
|
{ field: 'tradeprice', label: '成交价格' },
|
|
|
{ field: 'tradeqty', label: '成交数量' },
|
|
{ field: 'tradeqty', label: '成交数量' },
|
|
|
{ field: 'tradeamount', label: '成交金额' },
|
|
{ field: 'tradeamount', label: '成交金额' },
|
|
@@ -78,73 +149,56 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ field: 'operate', label: '操作', fixed: 'right' }
|
|
{ field: 'operate', label: '操作', fixed: 'right' }
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-filterOptons.inputList = [
|
|
|
|
|
- { label: '商品', keys: ['goodsId'] },
|
|
|
|
|
- { label: '成交单号', keys: ['tradeId'] },
|
|
|
|
|
- { label: '账户', keys: ['accountId'] },
|
|
|
|
|
- { label: '所属机构', keys: ['areaUserName'] },
|
|
|
|
|
-]
|
|
|
|
|
|
|
+// 表单验证规则
|
|
|
|
|
+const formRules: FormRules = {
|
|
|
|
|
+ marketId: [{ required: true }],
|
|
|
|
|
+ date: [{
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
|
+ if (dateValue.value.length === 2) {
|
|
|
|
|
+ callback()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ callback(new Error('请选择日期'))
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ }],
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-filterOptons.selectList = [
|
|
|
|
|
- {
|
|
|
|
|
- key: 'marketId',
|
|
|
|
|
- label: '市场',
|
|
|
|
|
- locked: true,
|
|
|
|
|
- options: () => getMarketOptions([15, 97, 99], true),
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- key: 'isHis',
|
|
|
|
|
- label: '查询类型',
|
|
|
|
|
- selectedValue: 0,
|
|
|
|
|
- locked: true,
|
|
|
|
|
- options: () => [
|
|
|
|
|
- { label: '当前', value: 0 },
|
|
|
|
|
- { label: '历史', value: 1 },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- key: 'buyOrSell',
|
|
|
|
|
- label: '方向',
|
|
|
|
|
- options: () => getBuyOrSellList(),
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- key: 'buildType',
|
|
|
|
|
- label: '类型',
|
|
|
|
|
- options: () => buildtypeEnum.getEnumOptions(),
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- key: 'tradeTypes',
|
|
|
|
|
- label: '成交类别',
|
|
|
|
|
- options: () => [],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- key: 'feeSearchType',
|
|
|
|
|
- label: '手续费',
|
|
|
|
|
- options: () => [],
|
|
|
|
|
|
|
+// 选择查询类型
|
|
|
|
|
+const onTypeChange = (value: number) => {
|
|
|
|
|
+ if (!value) {
|
|
|
|
|
+ dateValue.value = []
|
|
|
|
|
+ onDateChange()
|
|
|
}
|
|
}
|
|
|
-]
|
|
|
|
|
-
|
|
|
|
|
-filterOptons.buttonList = [
|
|
|
|
|
- { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
|
|
- { lable: '重置', className: 'el-button--primary', onClick: () => onSearch(true) }
|
|
|
|
|
-]
|
|
|
|
|
-
|
|
|
|
|
-const onSearch = (clear = false) => {
|
|
|
|
|
- processRequiredParams((qs) => run(qs), clear)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const openComponentOnClick = (code: string) => {
|
|
|
|
|
- processRequiredParams(() => openComponent(code))
|
|
|
|
|
|
|
+// 选择日期
|
|
|
|
|
+const onDateChange = () => {
|
|
|
|
|
+ const [startDate, endDate] = dateValue.value
|
|
|
|
|
+ queryParams.value.startDateHis = startDate
|
|
|
|
|
+ queryParams.value.endDateHis = endDate
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 处理请求参数
|
|
|
|
|
-const processRequiredParams = (callback: (params: Model.ContractSheetReq) => void, clear = false) => {
|
|
|
|
|
- const qs = getQueryParams(clear)
|
|
|
|
|
- if (qs.marketId) {
|
|
|
|
|
- queryParams.value = qs
|
|
|
|
|
- callback(qs)
|
|
|
|
|
|
|
+const onSearch = (clear = false) => {
|
|
|
|
|
+ if (clear) {
|
|
|
|
|
+ queryParams.value = {
|
|
|
|
|
+ isHis: 0,
|
|
|
|
|
+ }
|
|
|
|
|
+ dateValue.value = []
|
|
|
} else {
|
|
} else {
|
|
|
- ElMessage.warning('请选择市场')
|
|
|
|
|
|
|
+ formRef.value?.validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ run(queryParams.value)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const openComponentOnClick = (code: string) => {
|
|
|
|
|
+ formRef.value?.validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ openComponent(code)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|