|
@@ -2,51 +2,38 @@
|
|
|
<template>
|
|
<template>
|
|
|
<app-view>
|
|
<app-view>
|
|
|
<template #header>
|
|
<template #header>
|
|
|
- <el-form ref="formRef" class="el-form--filter" :model="queryParams" :rules="formRules" :show-message="false">
|
|
|
|
|
- <el-form-item label="报表类型" prop="cycletype">
|
|
|
|
|
- <el-select v-model="queryParams.cycletype">
|
|
|
|
|
|
|
+ <el-form ref="formRef" class="el-form--filter" :model="queryParams" :rules="formRules"
|
|
|
|
|
+ :show-message="false">
|
|
|
|
|
+ <el-form-item label="报表类型" prop="cycletype">
|
|
|
|
|
+ <el-select v-model="queryParams.cycletype" @change="onTypeChange">
|
|
|
<el-option v-for="item in getReportTypeList()" :key="item.value" :label="item.label"
|
|
<el-option v-for="item in getReportTypeList()" :key="item.value" :label="item.label"
|
|
|
:value="item.value" />
|
|
:value="item.value" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="开始日期" prop="reckondate">
|
|
|
|
|
- <el-date-picker :type="dateType" v-model="queryParams.reckondate" :format="dateFormat"
|
|
|
|
|
- :value-format="dateFormat" placeholder="请选择日期" @change="onReckonDateChange" />
|
|
|
|
|
|
|
+ <el-form-item label="日期" prop="reckondate">
|
|
|
|
|
+ <el-date-picker :type="dateType" v-model="dateValue" :format="dateFormat" :value-format="dateFormat"
|
|
|
|
|
+ placeholder="请选择" start-placeholder="开始" end-placeholder="结束" @change="onDateChange" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="结束日期" prop="reckondateend">
|
|
|
|
|
- <el-date-picker :type="dateType" v-model="queryParams.reckondateend" :format="dateFormat"
|
|
|
|
|
- :value-format="dateFormat" placeholder="请选择日期" @change="onReckonEndDateChange"/>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="开始季度" prop="quarter" v-if="queryParams.cycletype === ReportType.Quarter">
|
|
|
|
|
- <el-select v-model="queryParams.quarter">
|
|
|
|
|
- <el-option v-for="item in getQuarterList()" :key="item.value" :label="item.label"
|
|
|
|
|
- :value="item.value" />
|
|
|
|
|
|
|
+ <el-form-item label="季度" prop="quarter" v-if="queryParams.cycletype === ReportType.Quarter">
|
|
|
|
|
+ <el-select v-model="queryParams.quarter" @change="onQuarterChange">
|
|
|
|
|
+ <template v-for="item in getQuarterList()" :key="item.value">
|
|
|
|
|
+ <el-option :label="item.label" :value="item.value" />
|
|
|
|
|
+ </template>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="开始季度" prop="quarter" v-if="queryParams.cycletype === ReportType.Quarter">
|
|
|
|
|
- <el-select v-model="queryParams.quarterend">
|
|
|
|
|
- <el-option v-for="item in getQuarterList()" :key="item.value" :label="item.label"
|
|
|
|
|
- :value="item.value" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="资金账户" prop="accountid">
|
|
|
|
|
- <app-select-account v-model="queryParams.accountid" @change="onAccountChange" />
|
|
|
|
|
|
|
+ <el-form-item label="所属机构" prop="accountid">
|
|
|
|
|
+ <app-select-account v-model="queryParams.accountid" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="是否包含子机构" prop="isson">
|
|
<el-form-item label="是否包含子机构" prop="isson">
|
|
|
- <el-checkbox v-model="isson" size="small" />
|
|
|
|
|
|
|
+ <el-switch v-model="queryParams.type" active-value="1" inactive-value="0" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="onSearch">查询</el-button>
|
|
|
|
|
- <el-button type="primary" @click="onSearch(false)">重置</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="onSearch(false)">查询</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="onSearch(true)">重置</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
- <div class="report-account__info" v-if="selectedAccount">
|
|
|
|
|
- <span>账户:{{ selectedAccount.relatedname }}</span>
|
|
|
|
|
- <span>资金账户:{{ selectedAccount.accountid }}</span>
|
|
|
|
|
- <span>登录账号:{{ selectedAccount.invloginids }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
</template>
|
|
</template>
|
|
|
- <app-table :data="dataList" showIndex :columns="tableColumns" :loading="loading">
|
|
|
|
|
|
|
+ <app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
|
<template #headerLeft>
|
|
<template #headerLeft>
|
|
|
<app-operation :data-list="getFilteredButtons(['query_report_broker_export'])"
|
|
<app-operation :data-list="getFilteredButtons(['query_report_broker_export'])"
|
|
|
@click="openComponentOnClick" />
|
|
@click="openComponentOnClick" />
|
|
@@ -62,28 +49,23 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, ref, computed } from 'vue'
|
|
|
|
|
|
|
+import { ref, computed } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { orgReportQuery } from '@/services/api/report'
|
|
import { orgReportQuery } from '@/services/api/report'
|
|
|
import { useOperation } from '@/hooks/operation'
|
|
import { useOperation } from '@/hooks/operation'
|
|
|
-import { formatDate } from '@/filters'
|
|
|
|
|
-import { useUserStore } from '@/stores'
|
|
|
|
|
import { getReportTypeList, ReportType, getQuarterList } from '@/constants/report'
|
|
import { getReportTypeList, ReportType, getQuarterList } from '@/constants/report'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
import AppTable from '@pc/components/base/table/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'
|
|
|
import AppSelectAccount from '@pc/components/modules/select-account/index.vue'
|
|
import AppSelectAccount from '@pc/components/modules/select-account/index.vue'
|
|
|
|
|
|
|
|
-const userStore = useUserStore()
|
|
|
|
|
-const formRef = shallowRef<FormInstance>()
|
|
|
|
|
-const isson = ref(true)
|
|
|
|
|
-const selectedAccount = shallowRef<Model.TAAccountChildrenSelectRsp>()
|
|
|
|
|
|
|
+const formRef = ref<FormInstance>()
|
|
|
|
|
+const dateValue = ref<string[] | string>([])
|
|
|
|
|
|
|
|
const queryParams = ref<Partial<Model.OrgReportQueryReq>>({
|
|
const queryParams = ref<Partial<Model.OrgReportQueryReq>>({
|
|
|
- orgztypes: userStore.userInfo.orgztypes,
|
|
|
|
|
cycletype: 0,
|
|
cycletype: 0,
|
|
|
- type: isson.value ? 1 : 0
|
|
|
|
|
|
|
+ type: 0
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.OrgReportQueryRsp>({
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.OrgReportQueryRsp>({
|
|
@@ -94,9 +76,7 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(orgRep
|
|
|
manual: true,
|
|
manual: true,
|
|
|
params: {
|
|
params: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
- pageSize: 20,
|
|
|
|
|
- orgztypes: userStore.userInfo.orgztypes,
|
|
|
|
|
- type: isson.value ? 1 : 0
|
|
|
|
|
|
|
+ pageSize: 20
|
|
|
},
|
|
},
|
|
|
onError: (err) => {
|
|
onError: (err) => {
|
|
|
ElMessage.error(err)
|
|
ElMessage.error(err)
|
|
@@ -109,12 +89,13 @@ const dateType = computed(() => {
|
|
|
case ReportType.Week:
|
|
case ReportType.Week:
|
|
|
return 'week'
|
|
return 'week'
|
|
|
case ReportType.Month:
|
|
case ReportType.Month:
|
|
|
- return 'month'
|
|
|
|
|
|
|
+ return 'monthrange'
|
|
|
case ReportType.Quarter:
|
|
case ReportType.Quarter:
|
|
|
- case ReportType.Year:
|
|
|
|
|
return 'year'
|
|
return 'year'
|
|
|
|
|
+ case ReportType.Year:
|
|
|
|
|
+ return 'yearrange'
|
|
|
default:
|
|
default:
|
|
|
- return 'date'
|
|
|
|
|
|
|
+ return 'daterange'
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -122,55 +103,21 @@ const dateType = computed(() => {
|
|
|
const dateFormat = computed(() => {
|
|
const dateFormat = computed(() => {
|
|
|
switch (queryParams.value.cycletype) {
|
|
switch (queryParams.value.cycletype) {
|
|
|
case ReportType.Month:
|
|
case ReportType.Month:
|
|
|
- return 'YYYY-MM'
|
|
|
|
|
|
|
+ return 'YYYYMM'
|
|
|
case ReportType.Quarter:
|
|
case ReportType.Quarter:
|
|
|
case ReportType.Year:
|
|
case ReportType.Year:
|
|
|
return 'YYYY'
|
|
return 'YYYY'
|
|
|
default:
|
|
default:
|
|
|
- return 'YYYY-MM-DD'
|
|
|
|
|
|
|
+ return 'YYYYMMDD'
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const onReckonDateChange = () => {
|
|
|
|
|
- const reckondate = queryParams.value.reckondate
|
|
|
|
|
- if (reckondate) {
|
|
|
|
|
- switch (queryParams.value.cycletype) {
|
|
|
|
|
- case ReportType.Month:
|
|
|
|
|
- queryParams.value.reckondate = formatDate(reckondate, 'YYYY-MM')
|
|
|
|
|
- break
|
|
|
|
|
- case ReportType.Quarter:
|
|
|
|
|
- case ReportType.Year:
|
|
|
|
|
- queryParams.value.reckondate = formatDate(reckondate, 'YYYY')
|
|
|
|
|
- break
|
|
|
|
|
- default:
|
|
|
|
|
- queryParams.value.reckondate = formatDate(reckondate, 'YYYY-MM-DD')
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const onReckonEndDateChange = () => {
|
|
|
|
|
- const reckondateend = queryParams.value.reckondateend
|
|
|
|
|
- if (reckondateend) {
|
|
|
|
|
- switch (queryParams.value.cycletype) {
|
|
|
|
|
- case ReportType.Month:
|
|
|
|
|
- queryParams.value.reckondateend = formatDate(reckondateend, 'YYYY-MM')
|
|
|
|
|
- break
|
|
|
|
|
- case ReportType.Quarter:
|
|
|
|
|
- case ReportType.Year:
|
|
|
|
|
- queryParams.value.reckondateend = formatDate(reckondateend, 'YYYY')
|
|
|
|
|
- break
|
|
|
|
|
- default:
|
|
|
|
|
- queryParams.value.reckondateend = formatDate(reckondateend, 'YYYY-MM-DD')
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
|
|
|
|
+const tableColumns = ref<Model.TableColumn[]>([
|
|
|
{ field: 'cycleTime', label: '日期' },
|
|
{ field: 'cycleTime', label: '日期' },
|
|
|
{ field: 'accountName', label: '经纪会员' },
|
|
{ field: 'accountName', label: '经纪会员' },
|
|
|
- { field: 'investorTotalNum', label: '交易商开户数量' },
|
|
|
|
|
- { field: 'investorTrialNum', label: '交易商开户待初审数量' },
|
|
|
|
|
- { field: 'investorRetrialNum', label: '交易商开户待复审数量' },
|
|
|
|
|
|
|
+ { field: 'investorTotalNum', label: '交易商开户数量', width: 160 },
|
|
|
|
|
+ { field: 'investorTrialNum', label: '交易商开户待初审数量', width: 180 },
|
|
|
|
|
+ { field: 'investorRetrialNum', label: '交易商开户待复审数量', width: 180 },
|
|
|
{ field: 'investorAmount', label: '期末余额' },
|
|
{ field: 'investorAmount', label: '期末余额' },
|
|
|
{ field: 'investorusedmargin', label: '占用保证金' },
|
|
{ field: 'investorusedmargin', label: '占用保证金' },
|
|
|
{ field: 'investorClosePl', label: '转让损益' },
|
|
{ field: 'investorClosePl', label: '转让损益' },
|
|
@@ -185,24 +132,47 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
|
const formRules: FormRules = {
|
|
const formRules: FormRules = {
|
|
|
reckondate: [{ required: true }],
|
|
reckondate: [{ required: true }],
|
|
|
- reckondateend: [{ required: true }],
|
|
|
|
|
|
|
+ quarter: [{ required: true }],
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 选择类型
|
|
|
|
|
+const onTypeChange = (value: number) => {
|
|
|
|
|
+ if (value === ReportType.Week || value === ReportType.Quarter) {
|
|
|
|
|
+ dateValue.value = ''
|
|
|
|
|
+ } else {
|
|
|
|
|
+ dateValue.value = []
|
|
|
|
|
+ }
|
|
|
|
|
+ queryParams.value.reckondate = undefined
|
|
|
|
|
+ queryParams.value.reckondateend = undefined
|
|
|
|
|
+ queryParams.value.quarter = undefined
|
|
|
|
|
+ queryParams.value.quarterend = undefined
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 选择日期
|
|
|
|
|
+const onDateChange = () => {
|
|
|
|
|
+ if (Array.isArray(dateValue.value)) {
|
|
|
|
|
+ const [startDate, endDate] = dateValue.value
|
|
|
|
|
+ queryParams.value.reckondate = startDate
|
|
|
|
|
+ queryParams.value.reckondateend = endDate
|
|
|
|
|
+ } else {
|
|
|
|
|
+ queryParams.value.reckondate = dateValue.value
|
|
|
|
|
+ queryParams.value.reckondateend = dateValue.value
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const onAccountChange = (item?: Model.TAAccountChildrenSelectRsp) => {
|
|
|
|
|
- selectedAccount.value = item
|
|
|
|
|
|
|
+// 选择季度
|
|
|
|
|
+const onQuarterChange = (value: number) => {
|
|
|
|
|
+ queryParams.value.quarterend = value
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const onSearch = (clear = false) => {
|
|
const onSearch = (clear = false) => {
|
|
|
- if (!clear) {
|
|
|
|
|
|
|
+ if (clear) {
|
|
|
queryParams.value = {
|
|
queryParams.value = {
|
|
|
cycletype: 0,
|
|
cycletype: 0,
|
|
|
- reckondate: '',
|
|
|
|
|
- reckondateend: '',
|
|
|
|
|
- type: isson.value ? 1 : 0,
|
|
|
|
|
- orgztypes: userStore.userInfo.orgztypes
|
|
|
|
|
|
|
+ type: 0
|
|
|
}
|
|
}
|
|
|
|
|
+ dateValue.value = []
|
|
|
} else {
|
|
} else {
|
|
|
- queryParams.value.type = isson.value ? 1 : 0
|
|
|
|
|
formRef.value?.validate((valid) => {
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
run(queryParams.value)
|
|
run(queryParams.value)
|
|
@@ -212,14 +182,6 @@ const onSearch = (clear = false) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const openComponentOnClick = (code: string) => {
|
|
const openComponentOnClick = (code: string) => {
|
|
|
- processRequiredParams(() => openComponent(code))
|
|
|
|
|
|
|
+ openComponent(code)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-// 处理请求参数
|
|
|
|
|
-const processRequiredParams = (callback: (params: Model.OrgReportQueryReq) => void, clear = false) => {
|
|
|
|
|
- queryParams.value.type = isson.value ? 1 : 0
|
|
|
|
|
- queryParams.value.orgztypes = userStore.userInfo.orgztypes
|
|
|
|
|
- onSearch(!clear)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
</script>
|
|
</script>
|