|
|
@@ -7,15 +7,16 @@
|
|
|
<el-option v-for="option in selectList" :key="option.value" :value="option.value"
|
|
|
:label="option.label" />
|
|
|
</el-select>
|
|
|
- <el-date-picker :type="reporttype === 1 ? 'date' : 'month'" placeholder="查询日期"
|
|
|
- :value-format="reporttype === 1 ? 'YYYYMMDD' : 'YYYYMM'" v-model="cycletime" />
|
|
|
- <el-button type="primary" @click="reloadData">查询</el-button>
|
|
|
+ <el-date-picker :type="pickerType" placeholder="查询日期" :value-format="pickerFormat" :clearable="false"
|
|
|
+ v-model="cycletime" />
|
|
|
+ <el-button type="primary" :loading="loading" @click="reloadData">查询</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <app-table-details title="账户信息" :data="ta" :label-width="180" :cell-props="accountDetailProps" :column="2">
|
|
|
+ <app-table-details title="账户信息" :data="currentAccount" :label-width="180" :cell-props="accountDetailProps"
|
|
|
+ :column="2">
|
|
|
<!-- 名称 -->
|
|
|
<template #accountname>
|
|
|
- {{ userinfo?.customername }}
|
|
|
+ {{ userInfo?.customername }}
|
|
|
</template>
|
|
|
<!-- 币种 -->
|
|
|
<template #currencyid>
|
|
|
@@ -26,25 +27,20 @@
|
|
|
{{ formatDate(value) }}
|
|
|
</template>
|
|
|
</app-table-details>
|
|
|
- <app-table-details v-if="reporttype === 1 && dtaaccounts.length != 0" title="资金信息" :data="dtaaccounts[0]"
|
|
|
- :label-width="180" :cell-props="taDetailProps" :column="2"></app-table-details>
|
|
|
- <app-table-details v-if="reporttype === 2 && mtaaccounts.length != 0" title="资金信息" :data="mtaaccounts[0]"
|
|
|
- :label-width="180" :cell-props="taDetailProps" :column="2"></app-table-details>
|
|
|
- <app-table :data="logs" v-model:columns="logsTableColumns">
|
|
|
- <template #headerLeft>
|
|
|
- <span>出入金明细</span>
|
|
|
- </template>
|
|
|
- </app-table>
|
|
|
- <app-table :data="dpostions" v-model:columns="dpostionsTableColumns" >
|
|
|
- <template #headerLeft>
|
|
|
- <span>持仓汇总</span>
|
|
|
- </template>
|
|
|
- </app-table>
|
|
|
- <app-table :data="tradedetails" v-model:columns="tradeDetailsTableColumns" >
|
|
|
- <template #headerLeft>
|
|
|
- <span>成交明细</span>
|
|
|
- </template>
|
|
|
- </app-table>
|
|
|
+ <app-table-details title="资金信息" :data="taaccount" :label-width="180" :cell-props="taDetailProps" :column="2"
|
|
|
+ v-if="taaccount" />
|
|
|
+ <fieldset class="g-fieldset">
|
|
|
+ <legend class="g-fieldset__legend">出入金明细</legend>
|
|
|
+ <app-table :data="logs" v-model:columns="logsTableColumns" />
|
|
|
+ </fieldset>
|
|
|
+ <fieldset class="g-fieldset">
|
|
|
+ <legend class="g-fieldset__legend">持仓汇总</legend>
|
|
|
+ <app-table :data="dpostions" v-model:columns="dpostionsTableColumns" />
|
|
|
+ </fieldset>
|
|
|
+ <fieldset class="g-fieldset">
|
|
|
+ <legend class="g-fieldset__legend">成交明细</legend>
|
|
|
+ <app-table :data="tradedetails" v-model:columns="tradeDetailsTableColumns" />
|
|
|
+ </fieldset>
|
|
|
<template #footer>
|
|
|
<el-button type="info" @click="onDisAgree">不同意</el-button>
|
|
|
<el-button type="primary" @click="onAgree">同意</el-button>
|
|
|
@@ -53,7 +49,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, shallowRef } from 'vue'
|
|
|
+import { ref, shallowRef, computed } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import eventBus from '@/services/bus'
|
|
|
import { useAccountStore, useUserStore } from '@/stores'
|
|
|
@@ -68,18 +64,21 @@ import AppTableDetails from '@pc/components/base/table-details/index.vue'
|
|
|
const show = ref(true)
|
|
|
const refresh = ref(false)
|
|
|
const router = useRouter()
|
|
|
+const loading = ref(false)
|
|
|
/// 报表类型 日报表-1 月报表-2
|
|
|
const reporttype = ref(1)
|
|
|
/// 查询时间
|
|
|
const cycletime = shallowRef(formatDate(new Date().toISOString(), 'YYYYMMDD'))
|
|
|
|
|
|
-const ta = useAccountStore().currentAccount
|
|
|
-const userinfo = useUserStore().userInfo
|
|
|
+const pickerType = computed(() => reporttype.value === 1 ? 'date' : 'month')
|
|
|
+const pickerFormat = computed(() => reporttype.value === 1 ? 'YYYYMMDD' : 'YYYYMM')
|
|
|
|
|
|
+const currentAccount = useAccountStore().currentAccount
|
|
|
+const userInfo = useUserStore().userInfo
|
|
|
+
|
|
|
+const taaccount = shallowRef<Model.ReportMonthTaaccountRsp | Model.ReportReckonDayTaaccountRsp>()
|
|
|
const logs = shallowRef<Model.ReportBankAccountOutInLogRsp[]>([])
|
|
|
-const mtaaccounts = shallowRef<Model.ReportMonthTaaccountRsp[]>([])
|
|
|
const dpostions = shallowRef<Model.ReportReckonDayPositionRsp[]>([])
|
|
|
-const dtaaccounts = shallowRef<Model.ReportReckonDayTaaccountRsp[]>([])
|
|
|
const tradedetails = shallowRef<Model.ReportTradeDetailRsp[]>([])
|
|
|
|
|
|
const onAgree = () => {
|
|
|
@@ -98,74 +97,58 @@ const onDisAgree = () => {
|
|
|
}
|
|
|
|
|
|
const reloadData = () => {
|
|
|
- /// 报表 - 交易商结算单 - 出入金明细
|
|
|
- queryReportBankAccountOutInLog({
|
|
|
- data: {
|
|
|
- tradedate: cycletime.value,
|
|
|
- reporttype: reporttype.value,
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- /// 查询成功
|
|
|
- if (res.data.length) {
|
|
|
- logs.value = res.data
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- if (reporttype.value === 2) {
|
|
|
- /// 表 - 交易商结算单 - 资金信息(月)
|
|
|
- queryReportMonthTaaccount({
|
|
|
+ loading.value = true
|
|
|
+ Promise.all([
|
|
|
+ /// 报表 - 交易商结算单 - 出入金明细
|
|
|
+ queryReportBankAccountOutInLog({
|
|
|
data: {
|
|
|
- cycletime: cycletime.value,
|
|
|
+ tradedate: cycletime.value,
|
|
|
+ reporttype: reporttype.value,
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- /// 查询成功
|
|
|
- if (res.data.length) {
|
|
|
- mtaaccounts.value = res.data
|
|
|
+ }),
|
|
|
+ (() => {
|
|
|
+ if (reporttype.value === 2) {
|
|
|
+ /// 表 - 交易商结算单 - 资金信息(月)
|
|
|
+ return queryReportMonthTaaccount({
|
|
|
+ data: {
|
|
|
+ cycletime: cycletime.value,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ /// 报表 - 交易商结算单 - 资金信息(日)
|
|
|
+ return queryReportReckonDayTaaccount({
|
|
|
+ data: {
|
|
|
+ reckondate: cycletime.value,
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
- } else {
|
|
|
- /// 报表 - 交易商结算单 - 资金信息(日)
|
|
|
- queryReportReckonDayTaaccount({
|
|
|
+ })(),
|
|
|
+ /// 报表 - 交易商结算单 - 持仓汇总
|
|
|
+ queryReportReckonDayPosition({
|
|
|
data: {
|
|
|
reckondate: cycletime.value,
|
|
|
+ reporttype: reporttype.value
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- /// 查询成功
|
|
|
- if (res.data.length) {
|
|
|
- dtaaccounts.value = res.data
|
|
|
+ }),
|
|
|
+ /// 报表 - 交易商结算单 - 成交明细
|
|
|
+ queryReportTradeDetail({
|
|
|
+ data: {
|
|
|
+ histradedate: cycletime.value,
|
|
|
+ reporttype: reporttype.value
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
-
|
|
|
- /// 报表 - 交易商结算单 - 持仓汇总
|
|
|
- queryReportReckonDayPosition({
|
|
|
- data: {
|
|
|
- reckondate: cycletime.value,
|
|
|
- reporttype: reporttype.value
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- /// 查询成功
|
|
|
- if (res.data.length) {
|
|
|
- dpostions.value = res.data
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- /// 报表 - 交易商结算单 - 成交明细
|
|
|
- queryReportTradeDetail({
|
|
|
- data: {
|
|
|
- histradedate: cycletime.value,
|
|
|
- reporttype: reporttype.value
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- /// 查询成功
|
|
|
- if (res.data.length) {
|
|
|
- tradedetails.value = res.data
|
|
|
- }
|
|
|
+ ]).then(([res1, res2, res3, res4]) => {
|
|
|
+ logs.value = res1.data
|
|
|
+ taaccount.value = res2.data[0]
|
|
|
+ dpostions.value = res3.data
|
|
|
+ tradedetails.value = res4.data
|
|
|
+ }).finally(() => {
|
|
|
+ loading.value = false
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const onChange = () => {
|
|
|
- cycletime.value = formatDate(cycletime.value, reporttype.value === 1 ? 'YYYYMMDD' : 'YYYYMM')
|
|
|
+ cycletime.value = formatDate(new Date().toISOString(), pickerFormat.value)
|
|
|
}
|
|
|
|
|
|
/// 账户信息
|