|
|
@@ -1,7 +1,155 @@
|
|
|
<!-- 查询管理-订单管理-订单日报表 -->
|
|
|
<template>
|
|
|
- <app-view></app-view>
|
|
|
+ <app-view>
|
|
|
+ <template #header>
|
|
|
+ <app-filter :option="filterOption" :rules="filterRules">
|
|
|
+ <template #startDate="{ item }">
|
|
|
+ <el-form-item :label="item.label" prop="date">
|
|
|
+ <el-date-picker type="daterange" v-model="dateValue" value-format="YYYYMMDD"
|
|
|
+ start-placeholder="开始时间" end-placeholder="结束时间" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template #goodsid="{ item }">
|
|
|
+ <el-form-item :label="item.label" prop="goodsid">
|
|
|
+ <app-select-goods v-model="item.value" trademodels="52" status="3,6,7" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template #areauserid="{ item }">
|
|
|
+ <el-form-item :label="item.label" prop="areauserid">
|
|
|
+ <app-select-member v-model="item.value" usertype="2" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template #currentUserId="{ item }">
|
|
|
+ <el-form-item :label="item.label" prop="currentUserId">
|
|
|
+ <app-select-investor v-model="item.value" />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </app-filter>
|
|
|
+ </template>
|
|
|
+ <app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
|
+ <template #headerLeft>
|
|
|
+ <app-operation :data-list="getActionButtons(['query_order_report_export'])"
|
|
|
+ @click="(code: string) => openComponent(code)" />
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
|
|
|
+ @change="onSearch" />
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+ <component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
+ </app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { shallowRef } from 'vue'
|
|
|
+import { ElMessage, FormRules } from 'element-plus'
|
|
|
+import { useDataFilter } from '@/hooks/datatable-v2'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { useOperation } from '@/hooks/operation'
|
|
|
+import { queryOrderDate } from '@/services/api/order'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+import AppPagination from '@pc/components/base/pagination/index.vue'
|
|
|
+import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
|
|
|
+import AppSelectGoods from '@pc/components/modules/select-goods/index.vue'
|
|
|
+import AppSelectInvestor from '@pc/components/modules/select-investor/index.vue'
|
|
|
+import AppSelectMember from '@pc/components/modules/select-member/index.vue'
|
|
|
+
|
|
|
+const dateValue = shallowRef<string[] | null>([])
|
|
|
+
|
|
|
+const { componentMap, componentId, record, openComponent, closeComponent, getActionButtons } = useOperation<Model.OrderDateRsp>({
|
|
|
+ onClose: () => onSearch()
|
|
|
+})
|
|
|
+
|
|
|
+const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryOrderDate, {
|
|
|
+ manual: true,
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20
|
|
|
+ },
|
|
|
+ onError: (err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { field: 'reckondate', label: '日期' },
|
|
|
+ { field: 'tradeid', label: '订单号' },
|
|
|
+ { field: 'userfullname', label: '客户' },
|
|
|
+ { field: 'areafullname', label: '所属会员' },
|
|
|
+ { field: 'goodsfullname', label: '商品/代码' },
|
|
|
+ { field: 'buyorselldisplay', label: '方向' },
|
|
|
+ { field: 'holderprice', label: '订单价格' },
|
|
|
+ { field: 'opennum', label: '原始数量' },
|
|
|
+ { field: 'tradeamount', label: '原始金额' },
|
|
|
+ { field: 'holdernum', label: '订单数量' },
|
|
|
+ { field: 'holderamount', label: '订单金额' },
|
|
|
+ { field: 'payeddeposit', label: '占用资金' },
|
|
|
+ { field: 'freezenum', label: '冻结数量' },
|
|
|
+ { field: 'deliverynum', label: '交收数量' },
|
|
|
+ { field: 'closepl', label: '终止盈亏' },
|
|
|
+ { field: 'floatpl', label: '浮动盈亏' },
|
|
|
+ { field: 'depositratedisplay', label: '风险率' },
|
|
|
+ { field: 'operatorcode', label: '操作人' }
|
|
|
+])
|
|
|
+
|
|
|
+// 表单验证规则
|
|
|
+const filterRules: FormRules = {
|
|
|
+ date: [{
|
|
|
+ required: true,
|
|
|
+ validator: () => {
|
|
|
+ return !!dateValue.value && dateValue.value.length === 2
|
|
|
+ }
|
|
|
+ }]
|
|
|
+}
|
|
|
+
|
|
|
+const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilter<Model.OrderDateReq>({
|
|
|
+ filters: [
|
|
|
+ {
|
|
|
+ field: 'startDate',
|
|
|
+ label: '日期',
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'goodsid',
|
|
|
+ label: '商品'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'tradeid',
|
|
|
+ label: '订单号'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'currentUserId',
|
|
|
+ label: '交易商'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'areauserid',
|
|
|
+ label: '所属会员'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ buttons: [
|
|
|
+ { label: '查询', className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
+ { label: '重置', className: 'el-button--primary', validateEvent: false, onClick: () => onReset() }
|
|
|
+ ]
|
|
|
+})
|
|
|
+
|
|
|
+// 处理请求参数
|
|
|
+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)
|
|
|
+}
|
|
|
+
|
|
|
+const onReset = () => {
|
|
|
+ dateValue.value = []
|
|
|
+ resetFilters()
|
|
|
+}
|
|
|
</script>
|