|
@@ -2,7 +2,33 @@
|
|
|
<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"
|
|
|
|
|
+ :show-message="false">
|
|
|
|
|
+ <el-form-item label="市场" prop="marketid">
|
|
|
|
|
+ <el-select v-model="queryParams.marketid">
|
|
|
|
|
+ <template v-for="item in getMarketOptions([15, 40, 41, 48, 51, 71, 97, 99], true)"
|
|
|
|
|
+ :key="item.value">
|
|
|
|
|
+ <el-option :label="item.label" :value="item.value" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="商品" prop="goodsid">
|
|
|
|
|
+ <el-input type="number" v-model="queryParams.goodsid" placeholder="请输入商品ID" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="用户" prop="accname">
|
|
|
|
|
+ <el-input v-model="queryParams.accname" placeholder="账户或名称模糊匹配" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="机构" prop="areauserid" v-if="userStore.userInfo.releType === 1">
|
|
|
|
|
+ <el-input type="number" v-model="queryParams.areauserid" placeholder="请输入机构ID" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="登录账号" prop="loginid">
|
|
|
|
|
+ <el-input v-model="queryParams.loginid" placeholder="请输入" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" @click="onSearch(false)">查询</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="onSearch(true)">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
</template>
|
|
</template>
|
|
|
<app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
<app-table :data="dataList" :columns="tableColumns" :loading="loading">
|
|
|
<template #headerLeft>
|
|
<template #headerLeft>
|
|
@@ -20,23 +46,24 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
|
|
|
|
+import { ref } from 'vue'
|
|
|
|
|
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
import { getBuyOrSellName } from '@/constants/order'
|
|
import { getBuyOrSellName } from '@/constants/order'
|
|
|
import { useMarket } from '@/hooks/market'
|
|
import { useMarket } from '@/hooks/market'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
|
-import { useDataFilter } from '@/hooks/datatable'
|
|
|
|
|
import { useOperation } from '@/hooks/operation'
|
|
import { useOperation } from '@/hooks/operation'
|
|
|
import { queryPositionSumSheet } from '@/services/api/order'
|
|
import { queryPositionSumSheet } from '@/services/api/order'
|
|
|
|
|
+import { useUserStore } from '@/stores'
|
|
|
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 AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
|
|
|
|
|
const { getMarketOptions } = useMarket()
|
|
const { getMarketOptions } = useMarket()
|
|
|
-const queryParams = shallowRef<Model.PositionSumSheetReq>()
|
|
|
|
|
|
|
|
|
|
-const { filterOptons, getQueryParams } = useDataFilter<Model.PositionSumSheetReq>()
|
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
|
|
+const formRef = ref<FormInstance>()
|
|
|
|
|
+
|
|
|
|
|
+const queryParams = ref<Partial<Model.PositionSumSheetReq>>({})
|
|
|
|
|
|
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.PositionSumSheetRsp>({
|
|
const { componentMap, componentId, record, openComponent, closeComponent, getFilteredButtons } = useOperation<Model.PositionSumSheetRsp>({
|
|
|
onClose: () => onSearch()
|
|
onClose: () => onSearch()
|
|
@@ -53,7 +80,7 @@ const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryP
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
|
|
|
|
+const tableColumns = ref<Model.TableColumn[]>([
|
|
|
{ field: 'goodsCodeName', label: '商品代码/名称' },
|
|
{ field: 'goodsCodeName', label: '商品代码/名称' },
|
|
|
{ field: 'accountidname', label: '账户' },
|
|
{ field: 'accountidname', label: '账户' },
|
|
|
{ field: 'loginids', label: '登录账号' },
|
|
{ field: 'loginids', label: '登录账号' },
|
|
@@ -70,42 +97,28 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ field: 'floatPL', label: '持仓损益(总)' }
|
|
{ field: 'floatPL', label: '持仓损益(总)' }
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-filterOptons.inputList = [
|
|
|
|
|
- { label: '商品', keys: ['goodsid'] },
|
|
|
|
|
- { label: '用户', keys: ['accname'] },
|
|
|
|
|
- { label: '登录账号', keys: ['loginid'] },
|
|
|
|
|
-]
|
|
|
|
|
-
|
|
|
|
|
-filterOptons.selectList = [
|
|
|
|
|
- {
|
|
|
|
|
- key: 'marketid',
|
|
|
|
|
- label: '市场',
|
|
|
|
|
- locked: true,
|
|
|
|
|
- options: () => getMarketOptions(),
|
|
|
|
|
- }
|
|
|
|
|
-]
|
|
|
|
|
-
|
|
|
|
|
-filterOptons.buttonList = [
|
|
|
|
|
- { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() },
|
|
|
|
|
- { lable: '重置', className: 'el-button--primary', onClick: () => onSearch(true) }
|
|
|
|
|
-]
|
|
|
|
|
|
|
+// 表单验证规则
|
|
|
|
|
+const formRules: FormRules = {
|
|
|
|
|
+ marketid: [{ required: true }],
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const onSearch = (clear = false) => {
|
|
const onSearch = (clear = false) => {
|
|
|
- processRequiredParams((qs) => run(qs), clear)
|
|
|
|
|
|
|
+ if (clear) {
|
|
|
|
|
+ queryParams.value = {}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ formRef.value?.validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ run(queryParams.value)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const openComponentOnClick = (code: string) => {
|
|
const openComponentOnClick = (code: string) => {
|
|
|
- processRequiredParams(() => openComponent(code))
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 处理请求参数
|
|
|
|
|
-const processRequiredParams = (callback: (params: Model.PositionSumSheetReq) => void, clear = false) => {
|
|
|
|
|
- const qs = getQueryParams(clear)
|
|
|
|
|
- if (qs.marketid) {
|
|
|
|
|
- queryParams.value = qs
|
|
|
|
|
- callback(qs)
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage.warning('请选择市场')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ formRef.value?.validate((valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ openComponent(code)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|