li.shaoyi 1 jaar geleden
bovenliggende
commit
134c62ff20

+ 4 - 4
src/packages/pc/components/base/table-filter-v2/index.vue

@@ -19,7 +19,7 @@
         @click="handleButtonClick(item)">{{ item.label }}
       </el-button>
     </el-form-item>
-    <slot name="default"></slot>
+    <slot></slot>
   </el-form>
 </template>
 
@@ -58,10 +58,10 @@ const formRules = computed<FormRules>(() => {
   return { ...rules, ...props.rules }
 })
 
-const handleButtonClick = ({ validateEvent, onClick }: ActionButton) => {
+const handleButtonClick = ({ validateEvent = true, onClick }: ActionButton) => {
   if (validateEvent) {
-    formRef.value?.validate((valid) => {
-      if (valid) {
+    formRef.value?.validate((isValid) => {
+      if (isValid) {
         onClick()
       }
     })

+ 20 - 22
src/packages/pc/views/account/tradeacct/components/bankstatement/index.vue

@@ -3,7 +3,7 @@
     <teleport to="#appPageTeleport">
         <app-view>
             <template #header>
-                <app-filter :options="filterOptons" />
+                <app-filter :option="filterOption" />
             </template>
             <app-table :data="dataList" :columns="tableColumns" :loading="loading">
                 <template #headerLeft>
@@ -28,10 +28,10 @@
 import { shallowRef, PropType } from 'vue'
 import { ElMessage } from 'element-plus'
 import { useRequest } from '@/hooks/request'
-import { useDataFilter } from '@/hooks/datatable'
+import { useDataFilter } from '@/hooks/datatable-v2'
 import { queryAmountStream } from '@/services/api/account'
 import AppTable from '@pc/components/base/table/index.vue'
-import AppFilter from '@pc/components/base/table-filter/index.vue'
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import { i18n } from '@/stores'
 
@@ -46,8 +46,6 @@ const { global: { t } } = i18n
 
 const emit = defineEmits(['closed'])
 
-const { filterOptons, getQueryParams } = useDataFilter<Model.AmountStreamReq>()
-
 const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryAmountStream, {
     params: {
         logType: 1,
@@ -72,23 +70,23 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'amountAdjustTypeName', label: 'account.tradeacct.bankstatement.amountAdjustTypeName' },
 ])
 
-filterOptons.selectList = [
-    {
-        key: 'logType',
-        label: t('account.tradeacct.bankstatement.logType'),
-        selectedValue: 1,
-        locked: true,
-        options: () => [
-            { label: t('common.current'), value: 1 },
-            { label: t('common.history'), value: 2 },
-        ],
-    },
-]
-
-filterOptons.buttonList = [
-    { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
-    { label: t('operation.reset'), className: 'el-button--primary', onClick: () => onSearch(true) }
-]
+const { filterOption, getQueryParams } = useDataFilter<Model.AmountStreamReq>({
+    filters: [
+        {
+            field: 'logType',
+            label: t('account.tradeacct.bankstatement.logType'),
+            value: 1,
+            options: () => [
+                { label: t('common.current'), value: 1 },
+                { label: t('common.history'), value: 2 },
+            ],
+        }
+    ],
+    buttons: [
+        { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
+        { label: t('operation.reset'), className: 'el-button--primary', onClick: () => onSearch(true) }
+    ]
+})
 
 const onSearch = (clear = false) => {
     const qs = getQueryParams(clear)

+ 12 - 15
src/packages/pc/views/account/tradeacct/index.vue

@@ -2,7 +2,7 @@
 <template>
     <app-view>
         <template #header>
-            <app-filter :options="filterOptons" />
+            <app-filter :option="filterOption" />
         </template>
         <app-table :data="dataList" :columns="tableColumns" :loading="loading">
             <!-- 操作 -->
@@ -25,11 +25,11 @@ import { shallowRef } from 'vue'
 import { ElMessage } from 'element-plus'
 import { useEnum } from '@/hooks/enum'
 import { useRequest } from '@/hooks/request'
-import { useDataFilter } from '@/hooks/datatable'
+import { useDataFilter } from '@/hooks/datatable-v2'
 import { useOperation } from '@/hooks/operation'
 import { queryTaAccount } from '@/services/api/account'
 import AppTable from '@pc/components/base/table/index.vue'
-import AppFilter from '@pc/components/base/table-filter/index.vue'
+import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 import { i18n } from '@/stores'
@@ -43,8 +43,6 @@ const traderstatusEnum = useEnum('traderstatus')
 
 const { global: { t } } = i18n
 
-const { filterOptons, getQueryParams } = useDataFilter<Model.TaAccountReq>()
-
 const { componentMap, componentId, record, openComponent, closeComponent, getActionButtons } = useOperation<Model.TaAccountRsp>({
     onClose: () => onSearch()
 })
@@ -71,16 +69,15 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'operate', label: 'common.operate', width: 220, fixed: 'right' }
 ])
 
-filterOptons.inputList = [
-    {
-        label: t('account.tradeacct.accountId'), keys: ['accountId']
-    }
-]
-
-filterOptons.buttonList = [
-    { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
-    { label: t('operation.reset'), className: 'el-button--primary', onClick: () => onSearch(true) }
-]
+const { filterOption, getQueryParams } = useDataFilter<Model.TaAccountReq>({
+    filters: [
+        { label: t('account.tradeacct.accountId'), field: 'accountId' }
+    ],
+    buttons: [
+        { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
+        { label: t('operation.reset'), className: 'el-button--primary', onClick: () => onSearch(true) }
+    ]
+})
 
 const onSearch = (clear = false) => {
     const qs = getQueryParams(clear)

+ 2 - 2
src/packages/pc/views/investor/manage/user/components/account/index.vue

@@ -96,8 +96,8 @@ const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.ShowA
         }
     ],
     buttons: [
-        { label: t('operation.search'), className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
-        { label: t('operation.reset'), className: 'el-button--primary', onClick: () => resetFilters() }
+        { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
+        { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
     ]
 })
 

+ 2 - 2
src/packages/pc/views/investor/manage/user/components/config/index.vue

@@ -109,8 +109,8 @@ const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.Accou
         },
     ],
     buttons: [
-        { label: t('operation.search'), className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
-        { label: t('operation.reset'), className: 'el-button--primary', onClick: () => resetFilters() }
+        { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
+        { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
     ]
 })
 

+ 2 - 2
src/packages/pc/views/investor/manage/user/components/login/index.vue

@@ -113,8 +113,8 @@ const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.Inves
         },
     ],
     buttons: [
-        { label: t('operation.search'), className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
-        { label: t('operation.reset'), className: 'el-button--primary', onClick: () => resetFilters() }
+        { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
+        { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
     ]
 })
 

+ 129 - 0
src/packages/pc/views/query/order/deliveryorder/components/details/index.vue

@@ -0,0 +1,129 @@
+<!-- 查询管理-内部订单查询-交收委托查询-详情 -->
+<template>
+    <app-drawer title="交收委托(点选式)详细信息" width="960" v-model:show="show">
+        <app-table-details title="申报信息" :data="data" :label-width="200" :cell-props="detailProps1" :column="2" />
+        <app-table-details title="仓单信息" :data="data" :label-width="200" :cell-props="detailProps2" :column="2" />
+        <app-table-details title="交易合约" :data="data" :label-width="200" :cell-props="detailProps3" :column="2" />
+        <app-table-details title="辅助合约一" :data="data" :label-width="200" :cell-props="detailProps4" :column="2"
+            v-if="!!data?.ppricemode" />
+        <app-table-details title="辅助合约二" :data="data" :label-width="200" :cell-props="detailProps5" :column="2"
+            v-if="!!data?.p2pricemode" />
+        <template #footer>
+            <el-button @click="onCancel(false)">{{ t('operation.close') }}</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType, computed } from 'vue'
+import { ElMessage } from 'element-plus'
+import { formatDate } from '@/filters'
+import { useEnum } from '@/hooks/enum'
+import { useRequest } from '@/hooks/request'
+import { queryDeliveryOrderDetail } from '@/services/api/order'
+import { CellProp } from '@pc/components/base/table-details/types'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+import AppTableDetails from '@pc/components/base/table-details/index.vue'
+import { i18n } from '@/stores'
+
+const props = defineProps({
+    record: {
+        type: Object as PropType<Model.DeliveryOrderRsp>,
+        required: true
+    }
+})
+
+const { global: { t } } = i18n
+const show = shallowRef(true)
+const refresh = shallowRef(false)
+
+const deliveryorderstatus1Enum = useEnum('deliveryorderstatus1') // 交收状态
+
+const { data } = useRequest(queryDeliveryOrderDetail, {
+    params: {
+        deliveryorderid: props.record.deliveryorderid,
+        histradedate: props.record.histradedate
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
+const detailProps1 = computed(() => {
+    const { deliveryorderstatus = 0, histradedate, tradedate, accountname, accountid, matchaccountname, matchaccountid } = data.value ?? {}
+
+    const result: CellProp[] = [
+        { prop: 'deliveryticket', label: '申报流水号:' },
+        { prop: 'deliveryorderid', label: '委托单号:' },
+        { prop: 'tradedate', label: '交易日:', formatValue: () => formatDate(histradedate ? histradedate : tradedate, 'YYYY-MM-DD') },
+        { prop: 'accountid', label: '申报人(账号):', formatValue: (val) => val && `${accountname}(${accountid})` },
+        { prop: 'matchaccountid', label: '对手(账号):', formatValue: (val) => val && `${matchaccountname}(${matchaccountid})` },
+        { prop: 'deliveryorderstatus', label: '交收状态:', formatValue: (val) => deliveryorderstatus1Enum.getEnumTypeName(val) },
+        { prop: 'ordertime', label: '申报时间:', formatValue: (val) => formatDate(val) },
+        { prop: 'auditname', label: '审核人:', show: [2, 3].includes(deliveryorderstatus) },
+        { prop: 'audittime', label: '审核时间:', formatValue: (val) => formatDate(val), show: [2, 3].includes(deliveryorderstatus) },
+        { prop: 'auditremark', label: '备注:', show: deliveryorderstatus === 3 },
+        { prop: 'retcode', label: '错误信息:', show: deliveryorderstatus === 5 }
+    ]
+
+    return result
+})
+
+const detailProps2 = computed(() => {
+    const { deliveryqty = 0, deliverygoodsunitname = '', wrstandardcode, wrstandardname } = data.value ?? {}
+
+    const result: CellProp[] = [
+        { prop: 'wrstandardcode', label: '现货商品:', formatValue: (val) => val && `${wrstandardcode}/${wrstandardname}` },
+        { prop: 'deliveryqty', label: '现货数量:', formatValue: () => deliveryqty + deliverygoodsunitname },
+    ]
+
+    data.value?.wrFactorTypeItemList.forEach((item) => {
+        if (item.dgfactoryitemtypename) {
+            result.push({ prop: item.dgfactoryitemid.toString(), label: item.dgfactoryitemtypename + ':', formatValue: () => item.dgfactoryitemname })
+        }
+    })
+
+    return result
+})
+
+const detailProps3 = computed(() => {
+    const result: CellProp[] = [
+        { prop: 'xgoodsname', label: '交易合约:' },
+        { prop: 'xdeliveryprice', label: '交收价格:', decimal: 2 },
+        { prop: 'xdeliveryqty', label: '合约手数:' },
+    ]
+
+    return result
+})
+
+const detailProps4 = computed(() => {
+    const { ppricemode } = data.value ?? {}
+
+    const result: CellProp[] = [
+        { prop: 'ppricemode', label: '价格方式:' },
+        { prop: 'pgoodsname', label: '辅助合约一:', show: ppricemode === 1 },
+        { prop: 'pdeliveryprice', label: '交收价格:', decimal: 2, show: ppricemode === 2 },
+        { prop: 'pdeliveryqty', label: '合约手数:' },
+    ]
+
+    return result
+})
+
+const detailProps5 = computed(() => {
+    const { p2pricemode } = data.value ?? {}
+
+    const result: CellProp[] = [
+        { prop: 'p2pricemode', label: '价格方式:' },
+        { prop: 'p2goodsname', label: '辅助合约二:', show: p2pricemode === 1 },
+        { prop: 'p2deliveryprice', label: '交收价格:', decimal: 2, show: p2pricemode === 2 },
+        { prop: 'p2deliveryqty', label: '合约手数:' },
+    ]
+
+    return result
+})
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+</script>

+ 2 - 2
src/packages/pc/views/query/order/deliveryorder/index.vue

@@ -124,8 +124,8 @@ const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilte
         },
     ],
     buttons: [
-        { label: '查询', className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
-        { label: '重置', className: 'el-button--primary', onClick: () => onReset() }
+        { label: '查询', className: 'el-button--primary', onClick: () => onSearch() },
+        { label: '重置', className: 'el-button--primary', validateEvent: false, onClick: () => onReset() }
     ]
 })
 

+ 2 - 2
src/packages/pc/views/query/order/liquidation/index.vue

@@ -96,8 +96,8 @@ const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilte
         },
     ],
     buttons: [
-        { label: '查询', className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
-        { label: '重置', className: 'el-button--primary', onClick: () => resetFilters() }
+        { label: '查询', className: 'el-button--primary', onClick: () => onSearch() },
+        { label: '重置', className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
     ]
 })
 

+ 2 - 2
src/packages/pc/views/query/order/tradesumm/index.vue

@@ -102,8 +102,8 @@ const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilte
         },
     ],
     buttons: [
-        { label: '查询', className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
-        { label: '重置', className: 'el-button--primary', onClick: () => resetFilters() }
+        { label: '查询', className: 'el-button--primary', onClick: () => onSearch() },
+        { label: '重置', className: 'el-button--primary', validateEvent: false, onClick: () => resetFilters() }
     ]
 })
 

+ 2 - 2
src/packages/pc/views/query/other/bank_inout/index.vue

@@ -124,8 +124,8 @@ const { filterOption, getQueryParams, resetFilters } = useDataFilter<Model.PutOr
         }
     ],
     buttons: [
-        { label: t('operation.search'), className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
-        { label: t('operation.reset'), className: 'el-button--primary', onClick: () => onReset() }
+        { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
+        { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => onReset() }
     ]
 })
 

+ 2 - 2
src/packages/pc/views/query/other/bank_statement/index.vue

@@ -112,8 +112,8 @@ const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilte
         }
     ],
     buttons: [
-        { label: t('operation.search'), className: 'el-button--primary', validateEvent: true, onClick: () => onSearch() },
-        { label: t('operation.reset'), className: 'el-button--primary', onClick: () => onReset() }
+        { label: t('operation.search'), className: 'el-button--primary', onClick: () => onSearch() },
+        { label: t('operation.reset'), className: 'el-button--primary', validateEvent: false, onClick: () => onReset() }
     ]
 })
 

+ 7 - 0
src/services/api/order/index.ts

@@ -214,4 +214,11 @@ export function exportTradeSum(options: CommonFetchOptions<{ request: Model.Trad
  */
 export function queryDeliveryOrder(options: CommonFetchOptions<{ request: Model.DeliveryOrderReq; response: Model.DeliveryOrderRsp[]; }>) {
     return httpClient.commonRequest('/query/queryDeliveryOrder', 'get', options)
+}
+
+/**
+ * 内部订单查询--> 交收委托查询 --> 交收委托详情
+ */
+export function queryDeliveryOrderDetail(options: CommonFetchOptions<{ request: Model.DeliveryOrderDetailReq; response: Model.DeliveryOrderDetailRsp; }>) {
+    return httpClient.commonRequest('/query/deliveryOrderDetail', 'get', options)
 }

+ 51 - 0
src/types/model/order.d.ts

@@ -1306,4 +1306,55 @@ declare namespace Model {
         xdeliveryqty: string; // 主商品手数
         xgoodsname: string; // 主商品
     }
+
+    /** 内部订单查询--> 交收委托查询 --> 交收委托详情 请求 */
+    interface DeliveryOrderDetailReq {
+        deliveryorderid: string;
+        histradedate?: string;
+    }
+
+    /** 内部订单查询--> 交收委托查询 --> 交收委托详情 响应 */
+    interface DeliveryOrderDetailRsp {
+        accountid: number;
+        accountname: string; // 申报人(账号)
+        auditname: string; // 审核人
+        auditremark: string;
+        audittime: string; // 审核时间
+        deliverygoodsunitname: string;
+        deliveryorderid: string; // 委托单号
+        deliveryorderstatus: number; // 状态
+        deliveryqty: number; // 现货数量
+        deliveryticket: string; // 申报流水号
+        histradedate: string;
+        matchaccountid: number;
+        matchaccountname: string; // 对手(账号)
+        ordertime: string; // 申报时间
+        p2deliveryprice: number;
+        p2deliveryqty: number;
+        p2goodsname: string; // 辅助合约二
+        p2pricemode: number;
+        pdeliveryprice: number;
+        pdeliveryqty: number;
+        pgoodsname: string;
+        ppricemode: number; // 辅助合约一
+        retcode: string; // 错误信息
+        tradedate: string;
+        wrFactorTypeItemList: {
+            createtime: string; // 创建时间
+            creatorid: number; // 创建人
+            dgfactoryitemid: number; // 选择项ID
+            dgfactoryitemname: string;
+            dgfactoryitemtypeid: number; // 要素选择项类型ID
+            dgfactoryitemtypename: string;
+            updatetime: string; // 更新时间
+            updatorid: number; // 更新人
+            wrfactortypeid: string; // 仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+        }[]
+        wrfactortypeid: string;
+        wrstandardcode: string; // 现货商品
+        wrstandardname: string;
+        xdeliveryprice: number; // 交收价格
+        xdeliveryqty: number; // 合约数量
+        xgoodsname: string; // 交易合约
+    }
 }