瀏覽代碼

修改履约查询

huangbin 4 年之前
父節點
當前提交
930732cbe2

+ 13 - 3
src/views/search/search_document_records_commission_record_sub/components/filter/index.vue

@@ -19,20 +19,30 @@ import moment, { Moment } from 'moment';
 import { defineComponent, ref } from 'vue';
 export default defineComponent({
     emits: ['search'],
+    props: {
+        subtract: {
+            type: Number,
+            default: 1, // 与当天的时间 间隔的天数
+        },
+        rank: {
+            type: Number,
+            default: 7, // 搜索时间范围的之间的天数
+        }
+    },
     setup(props, context) {
         const onChange = (value: Moment[]) => {
             context.emit('search', value);
         };
         const time = ref<Moment[]>([
-            moment(moment().subtract(7, 'day')),
-            moment(moment().subtract(1, 'day'))
+            moment(moment().subtract(props.rank, 'day')),
+            moment(moment().subtract(props.subtract, 'day'))
         ])
         initData(() => {
             onChange(time.value)
         })
         function disabledDate(current: Moment) {
             // Can not select days before today and today
-            return current && current > moment(moment().subtract(1, 'day')).endOf('day');
+            return current && current > moment(moment().subtract(props.subtract, 'day')).endOf('day');
         }
         return {
             onChange,

+ 20 - 12
src/views/search/search_performance_query/search_performance_query_buy_performance/search_performance_query_buy_performance_done/index.vue

@@ -1,6 +1,7 @@
 <template>
   <!-- 履约查询 买履约 -->
-  <section class="topTableHeight">
+  <section class="topTableHeight_448 topTableHeight">
+    <Filter @search="search" :subtract="0" />
     <a-table
       :columns="columns"
       class="srcollYTable expandLeftTable"
@@ -47,26 +48,33 @@ import { expandIcon } from '@/common/setup/table/clolumn';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { QueryPerformancePlan } from '@/services/go/wrtrade';
-import { QueryPerformancePlanReq, WrPerformancePlan } from '@/services/go/wrtrade/interface';
+import { WrPerformancePlan } from '@/services/go/wrtrade/interface';
+import Filter from '@/views/search/search_document_records_commission_record_sub/components/filter/index.vue';
+import moment, { Moment } from 'moment';
 export default defineComponent({
   name: EnumRouterName.search_performance_query_buy_performance,
+  components: {
+    Filter,
+  },
   setup() {
     // 表格列表数据
     const { loading, tableList, queryTable } = queryTableList<WrPerformancePlan>();
-    // 获取列表数据
-    const queryTableAction = () => {
-      const param: QueryPerformancePlanReq = {
-        buyorsell: 0,
-      };
-      queryTable(QueryPerformancePlan, param);
-    };
     // 表格通用逻辑
     const param: ComposeOrderTableParam = {
-      queryFn: queryTableAction,
+      queryFn: () => { },
       tableName: 'table_pcweb_spot_trade_bottom_performance_info_buy',
       recordList: getRecordItemTab(),
     };
-
+    // 查询数据
+    const search = (value: Moment[]) => {
+      const param = {
+        enddate: moment(value[1]).format("YYYYMMDD"),
+        begindate: moment(value[0]).format("YYYYMMDD"),
+        buyorsell: BuyOrSell.buy,
+        status: '1,2,3,4,5,6,7,8,9,10'
+      }
+      queryTable(QueryPerformancePlan, param);
+    };
     return {
       ...handleComposeOrderTable<WrPerformancePlan>(param),
       loading,
@@ -75,7 +83,7 @@ export default defineComponent({
       getPerformanceStatusName,
       getPaymentTypeName,
       expandIcon,
-      BuyOrSell,
+      search,
     };
   },
 });

+ 21 - 12
src/views/search/search_performance_query/search_performance_query_sell_performance/search_performance_query_sell_performance_done/index.vue

@@ -1,6 +1,7 @@
 <template>
   <!-- 履约查询 卖履约 -->
-  <section class="topTableHeight">
+  <section class="topTableHeight_448 topTableHeight">
+    <Filter @search="search" :subtract="0" />
     <a-table
       :columns="columns"
       class="srcollYTable expandLeftTable"
@@ -47,26 +48,34 @@ import { expandIcon } from '@/common/setup/table/clolumn';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { QueryPerformancePlan } from '@/services/go/wrtrade';
-import { QueryPerformancePlanReq, WrPerformancePlan } from '@/services/go/wrtrade/interface';
-
+import { WrPerformancePlan } from '@/services/go/wrtrade/interface';
+import Filter from '@/views/search/search_document_records_commission_record_sub/components/filter/index.vue';
+import moment, { Moment } from 'moment';
 export default defineComponent({
   name: EnumRouterName.search_performance_query_sell_performance,
+  components: {
+    Filter,
+  },
   setup() {
     // 表格列表数据
     const { loading, tableList, queryTable } = queryTableList<WrPerformancePlan>();
-    // 获取列表数据
-    const queryTableAction = () => {
-      const param: QueryPerformancePlanReq = {
-        buyorsell: 1,
-      };
-      queryTable(QueryPerformancePlan, param);
-    };
+
     // 表格通用逻辑
     const param: ComposeOrderTableParam = {
-      queryFn: queryTableAction,
+      queryFn: () => { },
       tableName: 'table_pcweb_spot_trade_bottom_performance_info_sale',
       recordList: getRecordItemTab(),
     };
+    // 查询数据
+    const search = (value: Moment[]) => {
+      const param = {
+        enddate: moment(value[1]).format("YYYYMMDD"),
+        begindate: moment(value[0]).format("YYYYMMDD"),
+        buyorsell: BuyOrSell.sell,
+        status: '1,2,3,4,5,6,7,8,9,10'
+      }
+      queryTable(QueryPerformancePlan, param);
+    };
     return {
       ...handleComposeOrderTable<WrPerformancePlan>(param),
       loading,
@@ -75,7 +84,7 @@ export default defineComponent({
       getPaymentTypeName,
       getPerformanceStatusName,
       expandIcon,
-      BuyOrSell,
+      search,
     };
   },
 });