Handy_Cao 1 rok pred
rodič
commit
f309e1c5c2

+ 1 - 0
src/packages/pc/components/modules/select-account/index.vue

@@ -1,3 +1,4 @@
+<!-- 资金账户下拉列表 -->
 <template>
     <div class="el-form-item--col">
         <el-select ref="selectRef" v-model="selectedValue" :empty-values="[null, undefined, 0]" :loading="loading"

+ 1 - 0
src/packages/pc/components/modules/select-bank/index.vue

@@ -1,3 +1,4 @@
+<!-- 查询托管银行支持银行 -->
 <template>
     <div class="el-form-item--col">
         <el-select ref="selectRef" v-model="selectedItem" :loading="loading" :placeholder="placeholder"

+ 1 - 0
src/packages/pc/components/modules/select-investor/index.vue

@@ -1,3 +1,4 @@
+<!-- 子机构开户下拉查询推荐人 -->
 <template>
     <div class="el-form-item--col">
         <el-select ref="selectRef" v-model="selectedValue" :loading="loading" :placeholder="placeholder"

+ 4 - 1
src/packages/pc/views/report/broker/index.vue

@@ -84,7 +84,8 @@ const selectedAccount = shallowRef<Model.TAAccountChildrenSelectRsp>()
 const queryParams = reactive<Model.OrgReportQueryReq>({
     orgztypes: userStore.userInfo.orgztypes,
     cycletype: 0,
-    reckondate: ''
+    reckondate: '',
+    reckondateend: ''
 })
 
 const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.OrgReportQueryRsp>({
@@ -95,6 +96,7 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(orgRep
     params: {
         cycletype: 0,
         reckondate: '',
+        reckondateend: '',
         pageNum: 1,
         pageSize: 20,
         orgztypes: userStore.userInfo.orgztypes
@@ -107,6 +109,7 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(orgRep
 useRequest(queryCommonFlag, {
     onSuccess: (res) => {
         queryParams.reckondate = formatDate(res.data.tradedate, 'YYYY-MM-DD')
+        queryParams.reckondateend = formatDate(res.data.tradedate, 'YYYY-MM-DD')
     }
 })
 

+ 140 - 24
src/packages/pc/views/report/investor/index.vue

@@ -2,9 +2,58 @@
 <template>
     <app-view>
         <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="cycletype">
+                    <el-select v-model="queryParams.cycletype" @change="onTypeChange">
+                        <el-option v-for="item in getReportTypeList()" :key="item.value" :label="item.label"
+                            :value="item.value" />
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="开始日期" prop="reckondate">
+                    <el-date-picker :type="dateType" v-model="queryParams.reckondate" :format="dateFormat"
+                    :value-format="dateFormat" placeholder="请选择日期"/>
+                </el-form-item>
+                <el-form-item label="结束日期" prop="reckondateend">
+                    <el-date-picker :type="dateType" v-model="queryParams.reckondateend" :format="dateFormat"
+                    :value-format="dateFormat" placeholder="请选择日期"/>
+                </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-select>
+                </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>
+                <el-form-item label="入金金额" prop="inamount">
+                    <el-input-number v-model="queryParams.inamount" maxlength="50" placeholder="查询大于等于此数值的数据" />
+                </el-form-item>
+                <el-form-item label="出金金额" prop="outamount">
+                    <el-input-number v-model="queryParams.outamount" maxlength="50" placeholder="查询大于等于此数值的数据" />
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="primary" @click="onSearch">查询</el-button>
+                </el-form-item>
+            </el-form>
+            <div class="report-account__info" v-if="selectedAccount">
+                <span>账户:{{ selectedAccount.relatedname }}</span>
+                <span>资金账户:{{ selectedAccount.accountid }}</span>
+                <span>登录账号:{{ selectedAccount.invloginids }}</span>
+            </div>
         </template>
         <app-table :data="dataList" showIndex v-model:columns="tableColumns" :loading="loading">
+            <template #headerLeft>
+                <app-operation :data-list="getFilteredButtons(['query_report_investor_export'])"
+                    @click="openComponentOnClick" />
+            </template>
             <template #footer>
                 <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
                     @change="onSearch" />
@@ -16,23 +65,30 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
-import { ElMessage } from 'element-plus'
+import { shallowRef, reactive, computed } from 'vue'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { useRequest } from '@/hooks/request'
-import { useDataFilter } from '@/hooks/datatable'
 import { investorReportQuery } from '@/services/api/report'
+import { formatDate } from '@/filters'
 import { useOperation } from '@/hooks/operation'
 import { useUserStore } from '@/stores'
-import { getReportTypeList } from '@/constants/report'
+import { getReportTypeList, ReportType, getQuarterList } from '@/constants/report'
+import { queryCommonFlag } from '@/services/api/account'
 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 AppOperation from '@pc/components/base/operation/index.vue'
+import AppSelectAccount from '@pc/components/modules/select-account/index.vue'
 
-const queryParams = shallowRef<Model.InvestorReportReq>()
-const { filterOptons, getQueryParams } = useDataFilter<Model.InvestorReportReq>()
+const formRef = shallowRef<FormInstance>()
 const userStore = useUserStore()
+const selectedAccount = shallowRef<Model.TAAccountChildrenSelectRsp>()
+
+const queryParams = reactive<Model.InvestorReportReq>({
+    orgztypes: userStore.userInfo.orgztypes,
+    cycletype: 0
+})
 
-const { componentMap, componentId, record, closeComponent } = useOperation<Model.InvestorReportReq>({
+const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.InvestorReportRsp>({
     onClose: () => onSearch()
 })
 
@@ -47,6 +103,59 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(invest
     }
 })
 
+useRequest(queryCommonFlag, {
+    onSuccess: (res) => {
+        queryParams.reckondate = formatDate(res.data.tradedate, 'YYYY-MM-DD')
+        queryParams.reckondateend = formatDate(res.data.tradedate, 'YYYY-MM-DD')
+    }
+})
+
+// 日期类型
+const dateType = computed(() => {
+    switch (queryParams.cycletype) {
+        case ReportType.Week:
+            return 'week'
+        case ReportType.Month:
+            return 'month'
+        case ReportType.Quarter:
+        case ReportType.Year:
+            return 'year'
+        default:
+            return 'date'
+    }
+})
+
+
+// 日期格式
+const dateFormat = computed(() => {
+    switch (queryParams.cycletype) {
+        case ReportType.Month:
+            return 'YYYY-MM'
+        case ReportType.Quarter:
+        case ReportType.Year:
+            return 'YYYY'
+        default:
+            return 'YYYY-MM-DD'
+    }
+})
+
+const onTypeChange = (value: ReportType) => {
+    const dateValue = queryParams.reckondate
+    if (dateValue) {
+        switch (value) {
+            case ReportType.Month:
+            queryParams.reckondate = formatDate(dateValue, 'YYYY-MM')
+                break
+            case ReportType.Quarter:
+            case ReportType.Year:
+            queryParams.reckondate = formatDate(dateValue, 'YYYY')
+                break
+            default:
+            queryParams.reckondate = formatDate(dateValue, 'YYYY-MM-DD')
+        }
+    }
+}
+
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'reckondate', label: '日期' },
     { field: 'loginids', label: '登录账号' },
@@ -71,24 +180,31 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'riskrate', label: '风险率' }
 ])
 
-filterOptons.selectList = [
-    {
-        key: 'cycletype',
-        label: '报表类型',
-        selectedValue: 0,
-        locked: true,
-        options: getReportTypeList(),
-    }
-]
+// 表单验证规则
+const formRules: FormRules = {
+    reckondate: [{ required: true }],
+    reckondateend: [{ required: true }],
+}
 
-filterOptons.buttonList = [
-    { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() },
-    { lable: '重置', className: 'el-button--primary', onClick: () => onSearch(true) }
-]
+const onAccountChange = (item?: Model.TAAccountChildrenSelectRsp) => {
+    selectedAccount.value = item
+}
 
 const onSearch = (clear = false) => {
-    const qs = getQueryParams(clear)
-    run(qs)
+    processRequiredParams((qs) => run(qs), clear)
+}
+
+const openComponentOnClick = (code: string) => {
+    processRequiredParams(() => openComponent(code))
+}
+
+// 处理请求参数
+const processRequiredParams = (callback: (params: Model.InvestorReportReq) => void, clear = false) => {
+    formRef.value?.validate((valid) => {
+        if (valid) {
+            callback(queryParams)
+        }
+    })
 }
 
 </script>

+ 1 - 1
src/packages/pc/views/report/trade/index.vue

@@ -35,7 +35,7 @@
         </template>
         <app-table :data="dataList" showIndex v-model:columns="tableColumns" :loading="loading">
             <template #headerLeft>
-                <app-operation :data-list="getFilteredButtons(['query_order_institutionsumm_export'])"
+                <app-operation :data-list="getFilteredButtons(['query_report_trade_export'])"
                     @click="openComponentOnClick" />
             </template>
             <template #footer>