|
|
@@ -1,7 +1,91 @@
|
|
|
<!-- 报表查询-报表重算 -->
|
|
|
<template>
|
|
|
- <app-view></app-view>
|
|
|
+ <app-view>
|
|
|
+ <template #header>
|
|
|
+ <app-filter :option="filterOption" :rules="filterRules">
|
|
|
+ <template #startDate>
|
|
|
+ <el-form-item label="交易日" prop="date">
|
|
|
+ <el-date-picker type="daterange" v-model="dateValue" value-format="YYYYMMDD"
|
|
|
+ start-placeholder="开始时间" end-placeholder="结束时间" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <fieldset class="g-fieldset el-form--vertical">
|
|
|
+ <legend class="g-fieldset__legend">报表重算</legend>
|
|
|
+ <el-form-item>
|
|
|
+ <span>*选择交易日,当前交易日的所在周报表数据,月报表数据,季报表数据,年报表数据都会重算!</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <span>*等待10~20分钟后查看!</span>
|
|
|
+ </el-form-item>
|
|
|
+ </fieldset>
|
|
|
+ </app-filter>
|
|
|
+ </template>
|
|
|
+ </app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { shallowRef } from 'vue'
|
|
|
+import { ElMessage, FormRules } from 'element-plus'
|
|
|
+import { useDataFilter } from '@/hooks/datatable-v2'
|
|
|
+import { useOperation } from '@/hooks/operation'
|
|
|
+import { rerun } from '@/services/api/report'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
|
|
|
+
|
|
|
+const dateValue = shallowRef<string[] | null>([])
|
|
|
+
|
|
|
+const { run } = useRequest(rerun, {
|
|
|
+ manual: true,
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20
|
|
|
+ },
|
|
|
+ onSuccess: () => {
|
|
|
+ ElMessage.success('操作成功!')
|
|
|
+ },
|
|
|
+ onError: (err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+useOperation<Model.CommissionSheetRsp>({
|
|
|
+ onClose: () => onSearch()
|
|
|
+})
|
|
|
+
|
|
|
+// 表单验证规则
|
|
|
+const filterRules: FormRules = {
|
|
|
+ date: [{
|
|
|
+ required: true,
|
|
|
+ validator: () => {
|
|
|
+ return !!dateValue.value && dateValue.value.length === 2
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}
|
|
|
+
|
|
|
+const { filterOption, getQueryParams } = useDataFilter<Model.ReturnReq>({
|
|
|
+ filters: [
|
|
|
+ {
|
|
|
+ field: 'startDate',
|
|
|
+ label: '交易日',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ buttons: [
|
|
|
+ { label: '重新计算', className: 'el-button--primary', onClick: () => onSearch() }
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+// 处理请求参数
|
|
|
+const processRequiredParams = () => {
|
|
|
+ const qs = getQueryParams()
|
|
|
+ const [startDate, endDate] = dateValue.value || []
|
|
|
+ qs.startDate = startDate
|
|
|
+ qs.endDate = endDate
|
|
|
+ return qs
|
|
|
+}
|
|
|
+
|
|
|
+const onSearch = () => {
|
|
|
+ const qs = processRequiredParams()
|
|
|
+ run(qs)
|
|
|
+}
|
|
|
+
|
|
|
</script>
|