|
|
@@ -23,12 +23,11 @@
|
|
|
{{ 'RMB' }}
|
|
|
</template>
|
|
|
<!-- 结算时间 -->
|
|
|
- <template #tradestatuschangetime="{ value }">
|
|
|
- {{ formatDate(value) }}
|
|
|
+ <template #tradedate>
|
|
|
+ {{ tradeDate }}
|
|
|
</template>
|
|
|
</app-table-details>
|
|
|
- <app-table-details title="资金信息" :data="taaccount" :label-width="180" :cell-props="taDetailProps" :column="2"
|
|
|
- v-if="taaccount" />
|
|
|
+ <app-table-details title="资金信息" :data="taaccount" :label-width="180" :cell-props="taDetailProps" :column="2" />
|
|
|
<fieldset class="g-fieldset">
|
|
|
<legend class="g-fieldset__legend">出入金明细</legend>
|
|
|
<app-table :data="logs" v-model:columns="logsTableColumns" />
|
|
|
@@ -52,12 +51,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, shallowRef, computed } from 'vue'
|
|
|
+import { ref, shallowRef, computed, onMounted } from 'vue'
|
|
|
import eventBus from '@/services/bus'
|
|
|
import { useLoginStore, useAccountStore, useUserStore } from '@/stores'
|
|
|
import { formatDate } from '@/filters'
|
|
|
import { localData } from '@/stores/storage'
|
|
|
-import { onMounted } from 'vue'
|
|
|
+import { queryMarketRun } from '@/services/api/market'
|
|
|
import { queryReportBankAccountOutInLog, queryReportMonthTaaccount, queryReportReckonDayPosition, queryReportReckonDayTaaccount, queryReportTradeDetail } from '@/services/api/report'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
@@ -68,14 +67,28 @@ const loading = ref(false)
|
|
|
/// 报表类型 日报表-1 月报表-2
|
|
|
const reporttype = ref(1)
|
|
|
/// 查询时间
|
|
|
-const cycletime = shallowRef(formatDate(new Date().toISOString(), 'YYYYMMDD'))
|
|
|
+const cycletime = shallowRef('')
|
|
|
|
|
|
const pickerType = computed(() => reporttype.value === 1 ? 'date' : 'month')
|
|
|
const pickerFormat = computed(() => reporttype.value === 1 ? 'YYYYMMDD' : 'YYYYMM')
|
|
|
|
|
|
+// 结算日期
|
|
|
+const tradeDate = computed(() => {
|
|
|
+ if (taaccount.value) {
|
|
|
+ if ('reckondate' in taaccount.value) {
|
|
|
+ return formatDate(taaccount.value.reckondate, 'YYYY-MM-DD')
|
|
|
+ }
|
|
|
+ if ('cycletime' in taaccount.value) {
|
|
|
+ return formatDate(taaccount.value.cycletime, 'YYYY-MM')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return '--'
|
|
|
+})
|
|
|
+
|
|
|
const loginStore = useLoginStore()
|
|
|
const currentAccount = useAccountStore().currentAccount
|
|
|
const userInfo = useUserStore().userInfo
|
|
|
+const marketInfo = shallowRef<Model.MarketRunRsp>()
|
|
|
|
|
|
const taaccount = shallowRef<Model.ReportMonthTaaccountRsp | Model.ReportReckonDayTaaccountRsp>()
|
|
|
const logs = shallowRef<Model.ReportBankAccountOutInLogRsp[]>([])
|
|
|
@@ -110,67 +123,77 @@ const onDisAgree = () => {
|
|
|
eventBus.$emit('LogoutNotify')
|
|
|
}
|
|
|
|
|
|
+const onChange = () => {
|
|
|
+ const dateString = marketInfo.value?.pretradedate ?? new Date().toISOString()
|
|
|
+ cycletime.value = formatDate(dateString, pickerFormat.value)
|
|
|
+}
|
|
|
+
|
|
|
+// 查询市场上个交易日
|
|
|
+const getMarketRun = queryMarketRun().then((res) => {
|
|
|
+ marketInfo.value = res.data.find((e) => e.marketid === 0)
|
|
|
+ const dateString = marketInfo.value?.pretradedate ?? new Date().toISOString()
|
|
|
+ cycletime.value = formatDate(dateString, 'YYYYMMDD')
|
|
|
+})
|
|
|
+
|
|
|
const reloadData = () => {
|
|
|
loading.value = true
|
|
|
- Promise.all([
|
|
|
- /// 报表 - 交易商结算单 - 出入金明细
|
|
|
- queryReportBankAccountOutInLog({
|
|
|
- data: {
|
|
|
- tradedate: cycletime.value,
|
|
|
- reporttype: reporttype.value,
|
|
|
- }
|
|
|
- }),
|
|
|
- (() => {
|
|
|
- if (reporttype.value === 2) {
|
|
|
- /// 表 - 交易商结算单 - 资金信息(月)
|
|
|
- return queryReportMonthTaaccount({
|
|
|
- data: {
|
|
|
- cycletime: cycletime.value,
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- /// 报表 - 交易商结算单 - 资金信息(日)
|
|
|
- return queryReportReckonDayTaaccount({
|
|
|
- data: {
|
|
|
- reckondate: cycletime.value,
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })(),
|
|
|
- /// 报表 - 交易商结算单 - 持仓汇总
|
|
|
- queryReportReckonDayPosition({
|
|
|
- data: {
|
|
|
- reckondate: cycletime.value,
|
|
|
- reporttype: reporttype.value
|
|
|
- }
|
|
|
- }),
|
|
|
- /// 报表 - 交易商结算单 - 成交明细
|
|
|
- queryReportTradeDetail({
|
|
|
- data: {
|
|
|
- histradedate: cycletime.value,
|
|
|
- reporttype: reporttype.value
|
|
|
- }
|
|
|
+ getMarketRun.finally(() => {
|
|
|
+ Promise.all([
|
|
|
+ /// 报表 - 交易商结算单 - 出入金明细
|
|
|
+ queryReportBankAccountOutInLog({
|
|
|
+ data: {
|
|
|
+ tradedate: cycletime.value,
|
|
|
+ reporttype: reporttype.value,
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ (() => {
|
|
|
+ if (reporttype.value === 2) {
|
|
|
+ /// 表 - 交易商结算单 - 资金信息(月)
|
|
|
+ return queryReportMonthTaaccount({
|
|
|
+ data: {
|
|
|
+ cycletime: cycletime.value,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ /// 报表 - 交易商结算单 - 资金信息(日)
|
|
|
+ return queryReportReckonDayTaaccount({
|
|
|
+ data: {
|
|
|
+ reckondate: cycletime.value,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })(),
|
|
|
+ /// 报表 - 交易商结算单 - 持仓汇总
|
|
|
+ queryReportReckonDayPosition({
|
|
|
+ data: {
|
|
|
+ reckondate: cycletime.value,
|
|
|
+ reporttype: reporttype.value
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ /// 报表 - 交易商结算单 - 成交明细
|
|
|
+ queryReportTradeDetail({
|
|
|
+ data: {
|
|
|
+ histradedate: cycletime.value,
|
|
|
+ reporttype: reporttype.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ]).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
|
|
|
})
|
|
|
- ]).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(new Date().toISOString(), pickerFormat.value)
|
|
|
-}
|
|
|
-
|
|
|
/// 账户信息
|
|
|
const accountDetailProps = [
|
|
|
{ prop: 'currencyid', label: '币种:' },
|
|
|
{ prop: 'accountid', label: '账号:' },
|
|
|
{ prop: 'accountname', label: '名称:' },
|
|
|
- { prop: 'tradestatuschangetime', label: '结算日期:' },
|
|
|
+ { prop: 'tradedate', label: '结算日期:' },
|
|
|
]
|
|
|
|
|
|
/// 资金信息
|