|
@@ -2,9 +2,42 @@
|
|
|
<template>
|
|
<template>
|
|
|
<app-view>
|
|
<app-view>
|
|
|
<template #header>
|
|
<template #header>
|
|
|
- <app-filter :options="filterOptons" />
|
|
|
|
|
|
|
+ <el-form ref="formRef" class="el-form--filter" :model="queryParams" :rules="formRules">
|
|
|
|
|
+ <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="cycletime">
|
|
|
|
|
+ <el-date-picker :type="dateType" v-model="queryParams.cycletime" :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="accountid">
|
|
|
|
|
+ <app-select-account v-model="queryParams.userid" @change="onAccountChange" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" @click="onSearch">查询</el-button>
|
|
|
|
|
+ <el-button type="danger" @click="onSearch(false)"> 重置</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>
|
|
</template>
|
|
|
<app-table :data="dataList" showIndex v-model:columns="tableColumns" :loading="loading">
|
|
<app-table :data="dataList" showIndex v-model:columns="tableColumns" :loading="loading">
|
|
|
|
|
+ <template #headerLeft>
|
|
|
|
|
+ <app-operation :data-list="getFilteredButtons(['query_order_institutionsumm_export'])"
|
|
|
|
|
+ @click="openComponentOnClick" />
|
|
|
|
|
+ </template>
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
|
|
<app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
|
|
|
@change="onSearch" />
|
|
@change="onSearch" />
|
|
@@ -16,34 +49,98 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<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 { useRequest } from '@/hooks/request'
|
|
|
-import { useDataFilter } from '@/hooks/datatable'
|
|
|
|
|
import { queryTrade } from '@/services/api/report'
|
|
import { queryTrade } from '@/services/api/report'
|
|
|
|
|
+import { formatDate } from '@/filters'
|
|
|
import { useOperation } from '@/hooks/operation'
|
|
import { useOperation } from '@/hooks/operation'
|
|
|
-import { getReportTypeList } from '@/constants/report'
|
|
|
|
|
|
|
+import { queryCommonFlag } from '@/services/api/account'
|
|
|
|
|
+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 AppFilter from '@pc/components/base/table-filter/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 AppSelectAccount from '@pc/components/modules/select-account/index.vue'
|
|
|
|
|
|
|
|
-const queryParams = shallowRef<Model.TradeReq>()
|
|
|
|
|
-const { filterOptons, getQueryParams } = useDataFilter<Model.TradeReq>()
|
|
|
|
|
|
|
+const queryParams = reactive<Model.TradeReq>({
|
|
|
|
|
+ cycletype: 0,
|
|
|
|
|
+ cycletime: ''
|
|
|
|
|
+})
|
|
|
|
|
+const formRef = shallowRef<FormInstance>()
|
|
|
|
|
+const selectedAccount = shallowRef<Model.TAAccountChildrenSelectRsp>()
|
|
|
|
|
|
|
|
-const { componentMap, componentId, record, closeComponent } = useOperation<Model.TradeReq>({
|
|
|
|
|
|
|
+const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.TradeRsp>({
|
|
|
onClose: () => onSearch()
|
|
onClose: () => onSearch()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryTrade, {
|
|
const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryTrade, {
|
|
|
params: {
|
|
params: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
- pageSize: 20
|
|
|
|
|
|
|
+ pageSize: 20,
|
|
|
|
|
+ cycletype: 0,
|
|
|
|
|
+ cycletime: ''
|
|
|
},
|
|
},
|
|
|
onError: (err) => {
|
|
onError: (err) => {
|
|
|
ElMessage.error(err)
|
|
ElMessage.error(err)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+useRequest(queryCommonFlag, {
|
|
|
|
|
+ onSuccess: (res) => {
|
|
|
|
|
+ queryParams.cycletime = 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.cycletime
|
|
|
|
|
+ if (dateValue) {
|
|
|
|
|
+ switch (value) {
|
|
|
|
|
+ case ReportType.Month:
|
|
|
|
|
+ queryParams.cycletime = formatDate(dateValue, 'YYYY-MM')
|
|
|
|
|
+ break
|
|
|
|
|
+ case ReportType.Quarter:
|
|
|
|
|
+ case ReportType.Year:
|
|
|
|
|
+ queryParams.cycletime = formatDate(dateValue, 'YYYY')
|
|
|
|
|
+ break
|
|
|
|
|
+ default:
|
|
|
|
|
+ queryParams.cycletime = formatDate(dateValue, 'YYYY-MM-DD')
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onAccountChange = (item?: Model.TAAccountChildrenSelectRsp) => {
|
|
|
|
|
+ selectedAccount.value = item
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ field: 'goodsname', label: '商品代码/名称 ' },
|
|
{ field: 'goodsname', label: '商品代码/名称 ' },
|
|
|
{ field: 'marketname', label: '市场' },
|
|
{ field: 'marketname', label: '市场' },
|
|
@@ -55,24 +152,32 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ field: 'closecharge', label: '转让手续费' }
|
|
{ field: 'closecharge', label: '转让手续费' }
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-filterOptons.selectList = [
|
|
|
|
|
- {
|
|
|
|
|
- key: 'cycletype',
|
|
|
|
|
- label: '报表类型',
|
|
|
|
|
- selectedValue: 0,
|
|
|
|
|
- locked: true,
|
|
|
|
|
- options: getReportTypeList(),
|
|
|
|
|
- }
|
|
|
|
|
-]
|
|
|
|
|
-
|
|
|
|
|
-filterOptons.buttonList = [
|
|
|
|
|
- { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
|
|
- { lable: '重置', className: 'el-button--primary', onClick: () => onSearch(true) }
|
|
|
|
|
-]
|
|
|
|
|
|
|
+// 表单验证规则
|
|
|
|
|
+const formRules: FormRules = {
|
|
|
|
|
+ cycletime: [{ required: true }],
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const onSearch = (clear = false) => {
|
|
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.TradeReq) => void, clear = false) => {
|
|
|
|
|
+
|
|
|
|
|
+ if (!clear) {
|
|
|
|
|
+ queryParams.cycletime = ''
|
|
|
|
|
+ queryParams.cycletype = 0
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ formRef.value?.validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ callback(queryParams)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|