|
|
@@ -1,31 +1,219 @@
|
|
|
<!-- 交易商结算单 -->
|
|
|
<template>
|
|
|
- <app-drawer title="交易商结算单" width="80%" v-model:show="show" :refresh="refresh">
|
|
|
+ <app-drawer title="交易商结算单" :width="1000" v-model:show="show" :refresh="refresh">
|
|
|
+ <el-select placeholder="请选择" v-model="reporttype" @change="onChange">
|
|
|
+ <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="danger" @click="reloadData">查询</el-button>
|
|
|
+ <app-table-details title="账户信息" :data="ta" :label-width="180" :cell-props="accountDetailProps" :column="2" >
|
|
|
+ <!-- 名称 -->
|
|
|
+ <template #accountname>
|
|
|
+ {{ userinfo?.customername }}
|
|
|
+ </template>
|
|
|
+ <!-- 结算时间 -->
|
|
|
+ <template #currencyid>
|
|
|
+ {{ 'RMB' }}
|
|
|
+ </template>
|
|
|
+ <!-- 结算时间 -->
|
|
|
+ <template #tradestatuschangetime="{ value }">
|
|
|
+ {{ 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>
|
|
|
+ <span>出入金明细</span>
|
|
|
+ <app-table :data="logs" v-model:columns="logsTableColumns" />
|
|
|
+ <span>持仓汇总</span>
|
|
|
+ <app-table :data="dpostions" v-model:columns="dpostionsTableColumns" />
|
|
|
+ <span>成交明细</span>
|
|
|
+ <app-table :data="tradedetails" v-model:columns="tradeDetailsTableColumns" />
|
|
|
<template #footer>
|
|
|
- <el-button type="info" @click="onAgree(false)">同意进入系统</el-button>
|
|
|
+ <el-button type="info" @click="onAgree">同意进入系统</el-button>
|
|
|
<el-button type="danger" @click="onDisAgree">不同意,退出系统</el-button>
|
|
|
</template>
|
|
|
</app-drawer>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref } from 'vue'
|
|
|
+import { ref, shallowRef } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import eventBus from '@/services/bus'
|
|
|
+import { useAccountStore, useUserStore } from '@/stores'
|
|
|
+import { formatDate } from '@/filters'
|
|
|
+import { localData } from '@/stores/storage'
|
|
|
+import { onMounted } from 'vue'
|
|
|
+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'
|
|
|
+import AppTableDetails from '@pc/components/base/table-details/index.vue'
|
|
|
|
|
|
const show = ref(true)
|
|
|
const refresh = ref(false)
|
|
|
const router = useRouter()
|
|
|
+/// 报表类型 日报表-1 月报表-2
|
|
|
+const reporttype = ref(1)
|
|
|
+/// 查询时间
|
|
|
+const cycletime = shallowRef(formatDate(new Date().toISOString(), 'YYYYMMDD'))
|
|
|
|
|
|
-const onAgree = (isRefresh = false) => {
|
|
|
+const ta = useAccountStore().currentAccount
|
|
|
+const userinfo = useUserStore().userInfo
|
|
|
+
|
|
|
+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 = () => {
|
|
|
+ /// 记录时间和是否同意
|
|
|
+ localData.setValue('isReportAgree', true)
|
|
|
+ localData.setValue('reportTime', new Date().toISOString())
|
|
|
show.value = false
|
|
|
- refresh.value = isRefresh
|
|
|
+ refresh.value = false
|
|
|
}
|
|
|
|
|
|
const onDisAgree = () => {
|
|
|
+ /// 记录时间和是否同意
|
|
|
+ localData.setValue('isReportAgree', false)
|
|
|
eventBus.$emit('LogoutNotify')
|
|
|
router.replace({ name: 'login' })
|
|
|
}
|
|
|
|
|
|
+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({
|
|
|
+ data: {
|
|
|
+ cycletime: cycletime.value,
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ /// 查询成功
|
|
|
+ if (res.data.length) {
|
|
|
+ mtaaccounts.value = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ /// 报表 - 交易商结算单 - 资金信息(日)
|
|
|
+ queryReportReckonDayTaaccount({
|
|
|
+ data: {
|
|
|
+ reckondate: cycletime.value,
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ /// 查询成功
|
|
|
+ if (res.data.length) {
|
|
|
+ dtaaccounts.value = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ /// 报表 - 交易商结算单 - 持仓汇总
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const onChange = () => {
|
|
|
+ cycletime.value = formatDate(cycletime.value, reporttype.value === 1 ? 'YYYYMMDD' : 'YYYYMM')
|
|
|
+}
|
|
|
+
|
|
|
+/// 账户信息
|
|
|
+const accountDetailProps = [
|
|
|
+ { prop: 'currencyid', label: '币种:' },
|
|
|
+ { prop: 'accountid', label: '账号:' },
|
|
|
+ { prop: 'accountname', label: '名称:' },
|
|
|
+ { prop: 'tradestatuschangetime', label: '结算日期:' },
|
|
|
+]
|
|
|
+
|
|
|
+/// 资金信息
|
|
|
+const taDetailProps = [
|
|
|
+ { prop: 'balance', label: '期初余额:' },
|
|
|
+ { prop: '', label: '' },
|
|
|
+ { prop: 'inamount', label: '银行入金:' },
|
|
|
+ { prop: 'closepl', label: '平仓损益:' },
|
|
|
+ { prop: 'outamount', label: '银行出金:' },
|
|
|
+ { prop: 'reckonpl', label: '结算损益:' },
|
|
|
+ { prop: 'freezecharge', label: '服务费:' },
|
|
|
+ { prop: '', label: '' },
|
|
|
+ { prop: 'currentbalance', label: '期末余额:' },
|
|
|
+ { prop: '', label: '' },
|
|
|
+ { prop: 'oriusedmargin', label: '占用资金:' },
|
|
|
+ { prop: 'orioutamountfreeze', label: '冻结资金:' },
|
|
|
+ { prop: 'avaiablemoney', label: '可用资金:' },
|
|
|
+ { prop: 'avaiableoutmoney', label: '可出资金:' },
|
|
|
+]
|
|
|
+
|
|
|
+/// 出入金明细
|
|
|
+const logsTableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { prop: 'updatetime', label: '时间' },
|
|
|
+ { prop: 'executetypedisplay', label: '资金类型' },
|
|
|
+ { prop: 'amount', label: '金额' },
|
|
|
+ { prop: 'applystatusdisplay', label: '状态' },
|
|
|
+])
|
|
|
+
|
|
|
+/// 持仓汇总
|
|
|
+const dpostionsTableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { prop: 'goodsdisplay', label: '商品' },
|
|
|
+ { prop: 'buyorselldisplay', label: '方向' },
|
|
|
+ { prop: 'curpositionqty', label: '持有数量' },
|
|
|
+ { prop: 'frozenqty', label: '冻结数量' },
|
|
|
+ { prop: 'curholderamount', label: '持仓金额' },
|
|
|
+ { prop: 'avagepricedisplay', label: '均价' },
|
|
|
+])
|
|
|
+
|
|
|
+/// 成交明细
|
|
|
+const tradeDetailsTableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { prop: 'goodsdisplay', label: '商品' },
|
|
|
+ { prop: 'buyorselldisplay', label: '类型/方向', width: 100 },
|
|
|
+ { prop: 'tradeqty', label: '数量', width: 80 },
|
|
|
+ { prop: 'tradeprice', label: '价格', width: 80 },
|
|
|
+ { prop: 'tradeamount', label: '成交金额', width: 100 },
|
|
|
+ { prop: 'charge', label: '服务费', width: 80 },
|
|
|
+ { prop: 'tradetime', label: '时间' },
|
|
|
+])
|
|
|
+
|
|
|
+const selectList = [
|
|
|
+ { label: '日报表', value: 1 },
|
|
|
+ { label: '月报表', value: 2 },
|
|
|
+]
|
|
|
+
|
|
|
+/// 请求数据
|
|
|
+onMounted(() => {
|
|
|
+ reloadData()
|
|
|
+})
|
|
|
+
|
|
|
</script>
|