li.shaoyi 3 年 前
コミット
075e5606ca
28 ファイル変更534 行追加980 行削除
  1. 1 1
      src/common/constants/enumsName.ts
  2. 1 2
      src/layout/components/main.vue
  3. 6 1
      src/services/go/ermcp/goodsInfo/index.ts
  4. 4 17
      src/views/business/exposure/list/futures/index.vue
  5. 71 95
      src/views/business/exposure/list/futures/setup.ts
  6. 0 7
      src/views/business/exposure/list/realTime/index.vue
  7. 5 5
      src/views/business/exposure/list/spot/index.vue
  8. 70 93
      src/views/business/exposure/list/spot/setup.ts
  9. 11 1
      src/views/business/plan/list/audit/index.vue
  10. 41 41
      src/views/business/purchase/components/someprice/index.vue
  11. 3 3
      src/views/business/search/plan/index.vue
  12. 41 83
      src/views/business/search/plan/setup.ts
  13. 12 6
      src/views/business/search/spot/index.vue
  14. 102 178
      src/views/business/search/spot/setup.ts
  15. 51 81
      src/views/business/sell/components/someprice/index.vue
  16. 28 5
      src/views/business/sell/list/all/index.vue
  17. 13 1
      src/views/information/spot-contract/list/purchase/index.vue
  18. 13 1
      src/views/information/spot-contract/list/sell/index.vue
  19. 2 2
      src/views/manage/business-review/list/someprice/index.vue
  20. 1 1
      src/views/manage/finance-review/list/invoice/index.vue
  21. 0 1
      src/views/report/exposure-report/list/exposure_report/index.vue
  22. 1 1
      src/views/report/finance-report/list/finance_report_finance/index.vue
  23. 43 55
      src/views/report/spot-report/components/filterTable/index.vue
  24. 2 2
      src/views/report/spot-report/list/spot_report/index.vue
  25. 0 198
      src/views/report/spot-report/list/spot_report/setup.ts
  26. 6 18
      src/views/report/sum_pl_report/list/sum_pl_report/index.vue
  27. 0 80
      src/views/report/sum_pl_report/list/sum_pl_report/setup.ts
  28. 6 1
      src/views/search/inventory/list/inventory_current/index.vue

+ 1 - 1
src/common/constants/enumsName.ts

@@ -1501,7 +1501,7 @@ export function getChannelInnerOrderStatusName(status: number): string {
         case 3:
             return '委托失败';
         case 4:
-            return '委托部成部失败';
+            return '部分成交';
         case 5:
             return '委托成功';
         case 6:

+ 1 - 2
src/layout/components/main.vue

@@ -48,14 +48,13 @@ export default defineComponent({
 }
 .first-menu {
     width: 100%;
-    height: 35px;
     border-bottom: 1px solid @m-blue0 !important;
     background-color: @m-black1;
     .flex;
     justify-content: space-between;
     .a-menu_container {
         flex: 1;
-        padding-top: 2px;
+        margin-top: 2px;
         .flex();
         height: 32px;
         line-height: 32px;

+ 6 - 1
src/services/go/ermcp/goodsInfo/index.ts

@@ -16,6 +16,7 @@ import {
 } from './interface';
 import { Ermcp3MiddleGoodsDetail } from './interface/middlegoodsdetail'
 import { Ermcp3DeliveryGoodsDetailReq, Ermcp3DeliveryGoodsDetail } from './interface/deliverygoodsdetail'
+import { isOemByEnum, OemType } from '@/common/config/projectName';
 
 /**
  * 查询现货商品 /Ermcp3/QueryDeliveryGoods
@@ -247,7 +248,11 @@ export function QueryMiddleGoodsDetail(middlegoodsid?: number): Promise<Ermcp3Mi
  * @constructor
  */
 export function GetErmcpGoods(lastUpdateTime?: string): Promise<string> {
-    const param = lastUpdateTime ? { lastUpdateTime } : {}
+    const param = {
+        ...(isOemByEnum(OemType.manager) ? { userid: getUserId() } : {}),
+        ...(lastUpdateTime ? { lastUpdateTime } : {})
+    }
+
     return commonSearch_go('/Ermcp/GetErmcpGoods', param).then(async res => {
 
         if (res.length) {

+ 4 - 17
src/views/business/exposure/list/futures/index.vue

@@ -5,24 +5,11 @@
       <filterCustomTable @search="updateColumn"></filterCustomTable>
     </template>
     <template #default="{ scroll }">
-      <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :pagination="false" :rowKey="(record,index)=>index" :data-source="tableList">
-        <template #totalydqty="{ record }">
-          <span>{{ record.totalydqty + ' 手' }}</span>
-        </template>
-        <template #increaseqty="{ record }">
-          <span>{{ record.increaseqty + ' 手' }}</span>
-        </template>
-        <template #decreaseqty="{ record }">
-          <span>{{ record.decreaseqty + ' 手' }}</span>
-        </template>
-        <template #totalcurqty="{ record }">
-          <span>{{ record.totalcurqty + ' 手' }}</span>
-        </template>
-      </a-table>
+      <a-table :columns="getColumns()" class="srcollYTable" :scroll="scroll" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :pagination="false" :rowKey="(record,index)=>index" :data-source="tableList"></a-table>
     </template>
   </mtp-table-scroll>
   <!-- 明细 -->
-  <mtp-table-detail :columns="columnsDetail" :data-source="detailTableList" :tabs="tabList" v-model:visible="visible" @change="changeTab">
+  <mtp-table-detail :columns="getColumnsDetail()" :data-source="detailTableList" :tabs="tabList" v-model:visible="visible" @change="changeTab">
     <!-- 买卖方向 -->
     <template #buyorsell="{ record }">
       <span>{{ getBuyOrSellName(record.buyorsell) }}</span>
@@ -47,7 +34,7 @@ import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getBuyOrSellName, getChannelBuildName } from '@/common/constants/enumsName';
 import { getTableButton } from '@/common/setup/table/button';
-import { columns, columnsDetail } from './setup';
+import { getColumns, getColumnsDetail } from './setup';
 import MtpTableDetail from '@/common/components/tableDetail/index.vue';
 import moment from 'moment';
 
@@ -116,7 +103,7 @@ export default defineComponent({
         changeTab(tabIndex.value);
       }
     })
-    return { loading, tableList, visible, columns, changeTab, updateColumn, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, getBuyOrSellName, getChannelBuildName };
+    return { loading, tableList, visible, changeTab, updateColumn, getColumns, getColumnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, getBuyOrSellName, getChannelBuildName };
   },
 });
 </script>

+ 71 - 95
src/views/business/exposure/list/futures/setup.ts

@@ -1,112 +1,88 @@
 import { ErmcpHedgePosition, ErmcpHedgePositionDetail } from '@/services/go/ermcp/exposure/interface';
-import { ColumnType } from '@/common/methods/table';
 
 /**
  * 表头对应字段
  */
-export const columns: ColumnType[] = [
-    {
-        "key": "0th",
-        "title": "期货合约/代码",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: ErmcpHedgePosition }) => {
-            return `${record.goodsname}/${record.goodscode}`;
-        }
-    },
-    {
-        "key": "2th",
-        "dataIndex": "totalydqty",
-        "title": "昨日数量",
-        "align": "center",
-        "slots": {
-            "customRender": "totalydqty"
+export function getColumns() {
+    const columns = [
+        {
+            title: '期货合约/代码',
+            key: 'goodsid',
+            customRender: ({ record }: { record: ErmcpHedgePosition }) => `${record.goodsname}/${record.goodscode}`,
+        },
+        {
+            title: '当前数量',
+            key: 'totalcurqty',
+        },
+        {
+            title: '今日变更',
+            key: 'increaseqty',
+            customRender: ({ record }: { record: ErmcpHedgePosition }) => record.increaseqty + record.decreaseqty,
         },
-        "width": 120
-    },
-    {
-        "key": "3th",
-        "dataIndex": "increaseqty",
-        "title": "增加数量",
-        "align": "center",
-        "slots": {
-            "customRender": "increaseqty"
+        {
+            title: '昨日数量',
+            key: 'totalydqty'
         },
-        "width": 120
-    },
-    {
-        "key": "4th",
-        "dataIndex": "decreaseqty",
-        "title": "减少数量 ",
-        "align": "center",
-        "slots": {
-            "customRender": "decreaseqty"
+        {
+            title: '开仓数量',
+            key: 'increaseqty',
         },
-        "width": 130
-    },
-    {
-        "key": "5th",
-        "dataIndex": "totalcurqty",
-        "title": "当前数量",
-        "align": "center",
-        "slots": {
-            "customRender": "totalcurqty"
+        {
+            title: '平仓数量',
+            key: 'decreaseqty',
         },
-        "width": 120
-    }
-];
+    ];
+
+    return columns.map(el => {
+        return {
+            dataIndex: el.key,
+            width: 100,
+            align: 'center',
+            ...el
+        }
+    })
+}
 
 /**
  * 明细表头对应字段
  */
-export const columnsDetail: ColumnType[] = [
-    {
-        "key": "0th",
-        "dataIndex": "tradetime",
-        "title": "时间",
-        "align": "center",
-        "slots": {
-            "customRender": "tradetime"
+export function getColumnsDetail() {
+    const columns = [
+        {
+            title: '期货合约/代码',
+            key: 'hedgegoodsid',
+            customRender: ({ record }: { record: ErmcpHedgePositionDetail }) => `${record.goodsname}/${record.goodscode}`,
         },
-        "width": 200
-    },
-    {
-        "key": "1th",
-        "title": "期货合约/代码",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: ErmcpHedgePositionDetail }) => {
-            return `${record.goodsname}/${record.goodscode}`;
-        }
-    },
-    {
-        "key": "2th",
-        "dataIndex": "buyorsell",
-        "title": "方向",
-        "align": "center",
-        "slots": {
-            "customRender": "buyorsell"
+        {
+            title: '方向',
+            key: 'buyorsell',
+            slots: {
+                customRender: 'buyorsell'
+            },
+        },
+        {
+            title: '类型',
+            key: 'channelbuildtype',
+            slots: {
+                customRender: 'channelbuildtype'
+            },
         },
-        "width": 120
-    },
-    {
-        "key": "3th",
-        "dataIndex": "channelbuildtype",
-        "title": "类型",
-        "align": "center",
-        "slots": {
-            "customRender": "channelbuildtype"
+        {
+            title: '期货数量(手)',
+            key: 'tradeqty'
         },
-        "width": 120
-    },
-    {
-        "key": "4th",
-        "dataIndex": "tradeqty",
-        "title": "期货数量(手)",
-        "align": "center",
-        "slots": {
-            "customRender": "tradeqty"
+        {
+            title: '时间',
+            key: 'tradetime',
         },
-        "width": 130
-    }
-];
+    ];
+
+    return columns.map(el => {
+        return {
+            dataIndex: el.key,
+            width: 100,
+            align: 'center',
+            ...el
+        }
+    })
+}

+ 0 - 7
src/views/business/exposure/list/realTime/index.vue

@@ -19,18 +19,11 @@
         <template v-if="isPingAnOem()" #index="{ index }">
           <span>{{ index + 1 }}</span>
         </template>
-        <template #MiddleGoodsName="{ record }">
-          <span>{{ `${record.MiddleGoodsName}/${record.MiddleGoodsCode}` }}</span>
-        </template>
       </a-table>
     </template>
   </mtp-table-scroll>
   <!-- 明细 -->
   <mtp-table-detail :columns="columnsDetail" :data-source="detailTableList" :tabs="tabList" v-model:visible="visible" @change="changeTab">
-    <!-- 套保品种/代码 -->
-    <template #middlegoodsname="{ record }" v-if="!isPingAnOem()">
-      <span>{{ record.middlegoodsname + '/' + record.middlegoodscode }}</span>
-    </template>
     <template #convertfactor="{record}">
       <span>{{record.convertratio}}</span>
     </template>

+ 5 - 5
src/views/business/exposure/list/spot/index.vue

@@ -5,11 +5,11 @@
       <filterCustomTable @search="updateColumn"> </filterCustomTable>
     </template>
     <template #default="{ scroll }">
-      <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :pagination="false" :rowKey="(record,index)=>index" :data-source="tableList"></a-table>
+      <a-table :columns="getColumns()" class="srcollYTable" :scroll="scroll" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :pagination="false" :rowKey="(record,index)=>index" :data-source="tableList"></a-table>
     </template>
   </mtp-table-scroll>
   <!-- 明细 -->
-  <mtp-table-detail :columns="columnsDetail" :data-source="detailTableList" :tabs="tabList" v-model:visible="visible" @change="changeTab">
+  <mtp-table-detail :columns="getColumnsDetail()" :data-source="detailTableList" :tabs="tabList" v-model:visible="visible" @change="changeTab">
     <!-- 类型 -->
     <template #logtype="{ record }">
       <span>{{ getLogType(record.logtype) }}</span>
@@ -29,7 +29,7 @@ import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getLogType } from '@/common/constants/enumsName';
 import { getTableButton } from '@/common/setup/table/button';
-import { columns, columnsDetail } from './setup';
+import { getColumns, getColumnsDetail } from './setup';
 import MtpTableDetail from '@/common/components/tableDetail/index.vue';
 
 export default defineComponent({
@@ -102,14 +102,14 @@ export default defineComponent({
       visible,
       changeTab,
       updateColumn,
-      columnsDetail,
       detailTableList,
       expandedRowKeys,
       selectedRow,
       Rowclick,
       tabList,
       getLogType,
-      columns,
+      getColumns,
+      getColumnsDetail,
     };
   },
 });

+ 70 - 93
src/views/business/exposure/list/spot/setup.ts

@@ -1,105 +1,82 @@
 import { Ermcp3AreaSpot, Ermcp3AreaSpotDetail } from '@/services/go/ermcp/exposure/interface';
-import { ColumnType } from '@/common/methods/table';
 import { getContractTypeName } from '@/common/constants/enumsName';
 
 /**
  * 表头对应字段
  */
-export const columns: ColumnType[] = [
-    {
-        "key": "0th",
-        "title": "现货商品/代码",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: Ermcp3AreaSpot }) => {
-            return `${record.wrstandardname}/${record.wrstandardcode}`;
-        }
-    },
-    {
-        "key": "2th",
-        "dataIndex": "oritoalspotqty",
-        "title": "昨日数量",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: Ermcp3AreaSpot }) => {
-            return record.oritoalspotqty + record.enumdicname;
-        }
-    },
-    {
-        "key": "3th",
-        "dataIndex": "increaseqty",
-        "title": "增加数量",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: Ermcp3AreaSpot }) => {
-            return record.increaseqty + record.enumdicname;
-        }
-    },
-    {
-        "key": "4th",
-        "dataIndex": "decreaseqty",
-        "title": "减少数量",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: Ermcp3AreaSpot }) => {
-            return record.decreaseqty + record.enumdicname;
-        }
-    },
-    {
-        "key": "5th",
-        "dataIndex": "totalspotqty",
-        "title": "当前数量",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: Ermcp3AreaSpot }) => {
-            return record.totalspotqty + record.enumdicname;
+export function getColumns() {
+    const columns = [
+        {
+            title: '现货商品',
+            key: 'wrstandardname',
+        },
+        {
+            title: '当前数量',
+            key: 'totalspotqty',
+            customRender: ({ record }: { record: Ermcp3AreaSpot }) => record.totalspotqty + record.enumdicname,
+        },
+        {
+            title: '增加数量',
+            key: 'increaseqty',
+            customRender: ({ record }: { record: Ermcp3AreaSpot }) => record.increaseqty + record.enumdicname,
+        },
+        {
+            title: '减少数量',
+            key: 'decreaseqty',
+            customRender: ({ record }: { record: Ermcp3AreaSpot }) => record.decreaseqty + record.enumdicname,
+        },
+        {
+            title: '昨日数量',
+            key: 'oritoalspotqty',
+            customRender: ({ record }: { record: Ermcp3AreaSpot }) => record.oritoalspotqty + record.enumdicname,
+        },
+    ];
+
+    return columns.map(el => {
+        return {
+            dataIndex: el.key,
+            width: 100,
+            align: 'center',
+            ...el
         }
-    }
-];
+    })
+}
 
 /**
  * 明细表头对应字段
  */
-export const columnsDetail: ColumnType[] = [
-    {
-        "key": "0th",
-        "dataIndex": "createtime",
-        "title": "时间",
-        "align": "center",
-        "width": 200
-    },
-    {
-        "key": "1th",
-        "dataIndex": "relatedno",
-        "title": "编号 ",
-        "align": "center",
-        "width": 200
-    },
-    {
-        "key": "2th",
-        "dataIndex": "contracttype",
-        "title": "类型",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: Ermcp3AreaSpotDetail }) => {
-            return getContractTypeName(record.contracttype);
-        }
-    },
-    {
-        "key": "3th",
-        "dataIndex": "wrstandardname",
-        "title": "现货商品",
-        "align": "center",
-        "width": 120
-    },
-    {
-        "key": "4th",
-        "dataIndex": "qty",
-        "title": "现货商品数量",
-        "align": "center",
-        "width": 120,
-        customRender: ({ record }: { record: Ermcp3AreaSpotDetail }) => {
-            return record.qty + record.enumdicname;
+export function getColumnsDetail() {
+    const columns = [
+        {
+            title: '合同(计划)编号',
+            key: 'relatedno',
+        },
+        {
+            title: '类型',
+            key: 'contracttype',
+            customRender: ({ text }: { text: number }) => getContractTypeName(text),
+        },
+        {
+            title: '现货商品',
+            key: 'wrstandardname'
+        },
+        {
+            title: '现货商品数量',
+            key: 'qty',
+            customRender: ({ record }: { record: Ermcp3AreaSpotDetail }) => record.qty + record.enumdicname
+        },
+        {
+            title: '时间',
+            key: 'createtime',
+        },
+    ];
+
+    return columns.map(el => {
+        return {
+            dataIndex: el.key,
+            width: 100,
+            align: 'center',
+            ...el
         }
-    }
-];
+    })
+}

+ 11 - 1
src/views/business/plan/list/audit/index.vue

@@ -25,6 +25,7 @@
 </template>
 
 <script lang="ts">
+import { computed } from 'vue'
 import MtpTableScroll from '@/common/components/tableScroll/index.vue';
 import { queryTableList, MtpTableButton, contextMenu, defineAsyncComponent, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
 import { Filter } from '../../components';
@@ -75,8 +76,17 @@ export default defineComponent({
       isDetail: true,
     };
 
+    const compose = handleComposeTable<Ermcp3HedgePlan>(param);
+    const columns = computed(() => {
+      if (routeName === 'plan_checkpending') {
+        return compose.columns.value.filter((item) => item.dataIndex !== 'hedgeplanstatus')
+      }
+      return compose.columns.value;
+    })
+
     return {
-      ...handleComposeTable<Ermcp3HedgePlan>(param),
+      ...compose,
+      columns,
       loading,
       tableList,
       getPlanStatusName,

+ 41 - 41
src/views/business/purchase/components/someprice/index.vue

@@ -49,7 +49,7 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="点价合约">
-              <span class="white">{{ formatValue(selectedRow.goodsname) + selectedRow.currencyname }}</span>
+              <span class="white">{{ formatValue(selectedRow.goodsname) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -134,48 +134,48 @@ import { handleForm } from './setup';
 import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
-    name: 'purchase_pending_someprice',
-    components: {},
-    emits: ['cancel', 'update'],
-    props: {
-        selectedRow: {
-            type: Object as PropType<Ermcp3SellBuyContract>,
-            default: {},
-        },
+  name: 'purchase_pending_someprice',
+  components: {},
+  emits: ['cancel', 'update'],
+  props: {
+    selectedRow: {
+      type: Object as PropType<Ermcp3SellBuyContract>,
+      default: {},
     },
-    setup(props, context) {
-        const { visible, cancel } = _closeModal(context);
-        const loading = ref<boolean>(false);
-        const { rules, formState, formRef } = handleForm();
-        function submit() {
-            const wrapEl = unref(formRef);
-            wrapEl.validate().then(() => {
-                loading.value = true;
-                const params: SomePriceReq = {
-                    PricedPrice: Number(formState.PricedPrice),
-                    PricedQty: Number(formState.PricedQty),
-                };
-                // 发出点价请求
-                somePriceReq(props.selectedRow.spotcontractid, params, loading)
-                    .then((res) => {
-                        cancel(true);
-                    })
-                    .catch((err) => {});
-            });
-        }
-
-        return {
-            visible,
-            cancel,
-            submit,
-            loading,
-            formRef,
-            formState,
-            formatValue,
-            rules,
-            getPriceTypeName,
+  },
+  setup(props, context) {
+    const { visible, cancel } = _closeModal(context);
+    const loading = ref<boolean>(false);
+    const { rules, formState, formRef } = handleForm();
+    function submit() {
+      const wrapEl = unref(formRef);
+      wrapEl.validate().then(() => {
+        loading.value = true;
+        const params: SomePriceReq = {
+          PricedPrice: Number(formState.PricedPrice),
+          PricedQty: Number(formState.PricedQty),
         };
-    },
+        // 发出点价请求
+        somePriceReq(props.selectedRow.spotcontractid, params, loading)
+          .then((res) => {
+            cancel(true);
+          })
+          .catch((err) => { });
+      });
+    }
+
+    return {
+      visible,
+      cancel,
+      submit,
+      loading,
+      formRef,
+      formState,
+      formatValue,
+      rules,
+      getPriceTypeName,
+    };
+  },
 });
 </script>
 

+ 3 - 3
src/views/business/search/plan/index.vue

@@ -5,7 +5,7 @@
       <filterCustomTable @search="updateColumn"></filterCustomTable>
     </template>
     <template #default="{ scroll }">
-      <a-table :columns="columns" class="srcollYTable" :pagination="false" :rowKey="(record,index)=>index" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList" :scroll="scroll">
+      <a-table :columns="getColumns()" class="srcollYTable" :pagination="false" :rowKey="(record,index)=>index" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList" :scroll="scroll">
         <template #index="{ index }">
           <span>{{ index + 1 }}</span>
         </template>
@@ -20,7 +20,7 @@ import MtpTableScroll from '@/common/components/tableScroll/index.vue';
 import { queryTableList, MtpTableButton, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
 import filterCustomTable from './components/filter/index.vue';
 import { formatTime, formatValue } from '@/common/methods';
-import { columns } from './setup';
+import { getColumns } from './setup';
 import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 import { QueryHedgePlan } from '@/services/go/ermcp/plan';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
@@ -65,7 +65,7 @@ export default defineComponent({
       queryTable,
       formatTime,
       formatValue,
-      columns,
+      getColumns,
     };
   },
 });

+ 41 - 83
src/views/business/search/plan/setup.ts

@@ -1,87 +1,45 @@
-import { ColumnType } from '@/common/methods/table';
 import { getPlanContractType, getPlanStatusName } from '@/views/business/plan/setup';
 
-/**
- * 表头对应字段
- */
-export const columns: ColumnType[] = [
-    // {
-    //     key: '0th',
-    //     dataIndex: 'index',
-    //     title: '序号',
-    //     align: 'center',
-    //     slots: {
-    //         customRender: 'index',
-    //     },
-    //     width: 120,
-    // },
-    {
-        title: '状态',
-        dataIndex: 'hedgeplanstatus',
-        key: 'hedgeplanstatus',
-        align: 'center',
-        width: 120,
-        customRender: ({ text }: { text: number }) => {
-            return getPlanStatusName(text);
+export function getColumns() {
+    const columns = [
+        {
+            title: '计划名称',
+            key: 'hedgeplanno',
         },
-    },
-    {
-        title: '计划名称',
-        dataIndex: 'hedgeplanno',
-        key: 'hedgeplanno',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '类型',
-        dataIndex: 'contracttype',
-        key: 'contracttype',
-        align: 'center',
-        width: 120,
-        customRender: ({ text }: { text: number }) => {
-            return getPlanContractType(text);
+        {
+            title: '商品',
+            key: 'wrstandardname'
         },
-    },
-    {
-        title: '现货品种',
-        dataIndex: 'deliverygoodsname',
-        key: 'deliverygoodsname',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '商品',
-        dataIndex: 'wrstandardname',
-        key: 'wrstandardname',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '计划量',
-        dataIndex: 'planqty',
-        key: 'planqty',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '交易用户',
-        dataIndex: 'tradeusername',
-        key: 'tradeusername',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '结算币种',
-        dataIndex: 'currencyname',
-        key: 'currencyname',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '备注',
-        dataIndex: 'remark',
-        key: 'remark',
-        align: 'center',
-        width: 120,
-    },
-];
+        {
+            title: '类型',
+            key: 'contracttype',
+            customRender: ({ text }: { text: number }) => getPlanContractType(text),
+        },
+        {
+            title: '结算币种',
+            key: 'currencyname',
+        },
+        {
+            title: '计划量',
+            key: 'planqty',
+        },
+        {
+            title: '交易用户',
+            key: 'tradeusername',
+        },
+        {
+            title: '状态',
+            key: 'hedgeplanstatus',
+            customRender: ({ text }: { text: number }) => getPlanStatusName(text),
+        },
+    ];
+
+    return columns.map(el => {
+        return {
+            dataIndex: el.key,
+            width: 100,
+            align: 'center',
+            ...el
+        }
+    })
+}

+ 12 - 6
src/views/business/search/spot/index.vue

@@ -5,25 +5,28 @@
       <filterCustomTable @search="updateColumn"></filterCustomTable>
     </template>
     <template #default="{ scroll }">
-      <a-table :columns="columns" class="srcollYTable" :pagination="false" :rowKey="(record,index)=>index" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList" :scroll="scroll">
-        <template #index="{ index }">
-          <span>{{ index + 1 }}</span>
+      <a-table :columns="getColumns()" class="srcollYTable" :pagination="false" :rowKey="(record,index)=>index" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList" :scroll="scroll">
+        <template #expandedRowRender="{ record }">
+          <mtp-table-button class="btn-list-sticky" :buttons="buttons" :record="record" @click="openComponent" />
         </template>
       </a-table>
     </template>
   </mtp-table-scroll>
+  <!-- 右键 -->
+  <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="buttons"> </contextMenu>
   <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
 </template>
 
 <script lang="ts">
 import MtpTableScroll from '@/common/components/tableScroll/index.vue';
-import { queryTableList, MtpTableButton, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
+import { queryTableList, MtpTableButton, contextMenu, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
 import filterCustomTable from './components/filter/index.vue';
 import { formatTime, formatValue } from '@/common/methods';
-import { columns } from './setup';
+import { getColumns } from './setup';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { QuerySpotContract } from '@/services/go/ermcp/spot-contract';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { getTableButton } from '@/common/setup/table/button';
 import { useRoute } from 'vue-router';
 import moment from 'moment';
 
@@ -33,9 +36,11 @@ export default defineComponent({
     MtpTableScroll,
     filterCustomTable,
     MtpTableButton,
+    contextMenu,
   },
   setup() {
     const { name: routeName } = useRoute();
+    const buttons = getTableButton();
     // 表格列表数据
     const { loading, tableList, queryTable } = queryTableList<Ermcp3ContractRsp>();
 
@@ -79,10 +84,11 @@ export default defineComponent({
       ...handleComposeTable<Ermcp3ContractRsp>(param),
       loading,
       tableList,
+      buttons,
       queryTable,
       formatTime,
       formatValue,
-      columns,
+      getColumns,
     };
   },
 });

+ 102 - 178
src/views/business/search/spot/setup.ts

@@ -1,183 +1,107 @@
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
-import { ColumnType } from '@/common/methods/table';
-import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
+import { getBizTypeName, getContractStatusName, getPriceTypeName } from '@/common/constants/enumsName';
 import { formatTime, formatValue } from '@/common/methods';
 
-/**
- * 表头对应字段
- */
-export const columns: ColumnType[] = [
-    // {
-    //     key: '0th',
-    //     dataIndex: 'index',
-    //     title: '序号',
-    //     align: 'center',
-    //     slots: {
-    //         customRender: 'index',
-    //     },
-    //     width: 120,
-    // },
-    {
-        title: '状态',
-        dataIndex: 'contracctstatus',
-        key: 'contracctstatus',
-        align: 'center',
-        width: 120,
-        customRender: ({ text }: { text: number }) => {
-            return getContractStatusName(text);
-        },
-    },
-    {
-        title: '合同编号',
-        dataIndex: 'contractno',
-        key: 'contractno',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '类型',
-        dataIndex: 'contracttype',
-        key: 'contracttype',
-        align: 'center',
-        width: 120,
-        customRender: ({ text }: { text: number }) => {
-            return getContractTypeName(text);
-        },
-    },
-    {
-        title: '对手方',
-        key: 'username',
-        align: 'center',
-        width: 120,
-        customRender: ({ record }: { text: number, record: Ermcp3ContractRsp }) => {
-            // 根据合同类型显示对手方
-            if (record.contracttype === 1) {
-                return record.sellusername;
+export function getColumns() {
+    const columns = [
+        {
+            title: '合同编号',
+            key: 'contractno',
+            width: 150,
+        },
+        {
+            title: '对手方',
+            key: 'username',
+            customRender: ({ record }: { record: Ermcp3ContractRsp }) => {
+                // 根据合同类型显示对手方
+                if (record.contracttype === 1) {
+                    return record.sellusername;
+                }
+                return record.buyusername;
+            },
+        },
+        {
+            title: '商品',
+            key: 'goodsname'
+        },
+        {
+            title: '业务类型',
+            key: 'biztype',
+            customRender: ({ text }: { text: number }) => getBizTypeName(text),
+        },
+        {
+            title: '定价类型',
+            key: 'pricetype',
+            customRender: ({ text }: { text: number }) => getPriceTypeName(text),
+        },
+        {
+            title: '结算币种',
+            key: 'currencyname',
+        },
+        {
+            title: '合同量',
+            key: 'qty',
+        },
+        {
+            title: '价格',
+            key: 'price',
+        },
+        {
+            title: '升贴水',
+            key: 'pricemove',
+        },
+        {
+            title: '金额',
+            key: 'amount',
+        },
+        {
+            title: '保证金',
+            key: 'margin',
+        },
+        {
+            title: '点价合约',
+            key: 'goodscode',
+        },
+        {
+            title: '点价期',
+            key: 'startdate',
+            customRender: ({ record }: { record: Ermcp3ContractRsp }) => {
+                return formatValue(formatTime(record.startdate, 'd') + '--' + formatTime(record.enddate, 'd'));
             }
-            return record.buyusername;
-        }
-    },
-    {
-        title: '合同量',
-        dataIndex: 'qty',
-        key: 'qty',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '现货品种',
-        dataIndex: 'deliverygoodsname',
-        key: 'deliverygoodsname',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '商品',
-        dataIndex: 'goodsname',
-        key: 'goodsname',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '业务类型',
-        dataIndex: 'biztype',
-        key: 'biztype',
-        align: 'center',
-        width: 120,
-        customRender: ({ text }: { text: number }) => {
-            return getBizTypeName(text);
-        },
-    },
-    {
-        title: '定价类型',
-        dataIndex: 'pricetype',
-        key: 'pricetype',
-        align: 'center',
-        width: 120,
-        customRender: ({ text }: { text: number }) => {
-            return getPriceTypeName(text);
-        },
-    },
-    {
-        title: '点价合约',
-        dataIndex: 'goodscode',
-        key: 'goodscode',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '价格',
-        dataIndex: 'price',
-        key: 'price',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '升贴水',
-        dataIndex: 'pricemove',
-        key: 'pricemove',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '金额',
-        dataIndex: 'amount',
-        key: 'amount',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '保证金',
-        dataIndex: 'margin',
-        key: 'margin',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '点价期',
-        key: 'startdate',
-        align: 'center',
-        width: 120,
-        customRender: ({ record }: { record: Ermcp3ContractRsp }) => {
-            return formatValue(formatTime(record.startdate, 'd') + '--' + formatTime(record.enddate, 'd'));
-        }
-    },
-    {
-        title: '交收期',
-        dataIndex: 'deliverystartdate',
-        key: 'deliverystartdate',
-        align: 'center',
-        width: 120,
-        customRender: ({ record }: { record: Ermcp3ContractRsp }) => {
-            return formatValue(formatTime(record.deliverystartdate, 'd') + '--' + formatTime(record.deliveryenddate, 'd'));
+        },
+        {
+            title: '交收期',
+            key: 'deliverystartdate',
+            customRender: ({ record }: { record: Ermcp3ContractRsp }) => {
+                return formatValue(formatTime(record.deliverystartdate, 'd') + '--' + formatTime(record.deliveryenddate, 'd'));
+            }
+        },
+        {
+            title: '业务员',
+            key: 'saleusername',
+        },
+        {
+            title: '跟单员',
+            key: 'merusername',
+        },
+        {
+            title: '交易用户',
+            key: 'tradeusername',
+            width: 120,
+        },
+        {
+            title: '状态',
+            key: 'contracctstatus',
+            customRender: ({ text }: { text: number }) => getContractStatusName(text),
+        },
+    ];
+
+    return columns.map(el => {
+        return {
+            dataIndex: el.key,
+            width: 100,
+            align: 'center',
+            ...el
         }
-    },
-    {
-        title: '业务员',
-        dataIndex: 'saleusername',
-        key: 'saleusername',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '跟单员',
-        dataIndex: 'merusername',
-        key: 'merusername',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '交易用户',
-        dataIndex: 'tradeusername',
-        key: 'tradeusername',
-        align: 'center',
-        width: 120,
-    },
-    {
-        title: '结算币种',
-        dataIndex: 'currencyname',
-        key: 'currencyname',
-        align: 'center',
-        width: 120,
-    },
-];
+    })
+}

+ 51 - 81
src/views/business/sell/components/someprice/index.vue

@@ -1,20 +1,10 @@
 <template>
   <!-- 销售: 点价登记-->
-  <a-modal class="commonModal someprice"
-           title="点价登记"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           width="890px">
+  <a-modal class="commonModal someprice" title="点价登记" v-model:visible="visible" @cancel="cancel" centered width="890px">
     <template #footer>
-      <a-button key="submit"
-                class="cancelBtn"
-                @click="cancel">取消
+      <a-button key="submit" class="cancelBtn" @click="cancel">取消
       </a-button>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">点价登记
+      <a-button key="submit" type="primary" :loading="loading" @click="submit">点价登记
       </a-button>
     </template>
     <fieldset class="formFieldSet">
@@ -48,8 +38,7 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="合同签署量">
-              <span
-                    class="white">{{ formatValue(selectedRow.qty + selectedRow.enumdicname) }}</span>
+              <span class="white">{{ formatValue(selectedRow.qty + selectedRow.enumdicname) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -61,8 +50,7 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="点价合约">
-              <span
-                    class="white">{{ formatValue(selectedRow.goodsname) + selectedRow.currencyname }}</span>
+              <span class="white">{{ formatValue(selectedRow.goodsname) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -79,8 +67,7 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="已点均价">
-              <span
-                    class="white">{{ formatValue(selectedRow.pricedavg.toFixed(2))  + " 元" }}</span>
+              <span class="white">{{ formatValue(selectedRow.pricedavg.toFixed(2))  + " 元" }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -88,19 +75,11 @@
     </fieldset>
     <fieldset class="formFieldSet">
       <legend>本次点价信息</legend>
-      <a-form class="inlineForm"
-              ref="formRef"
-              :model="formState"
-              :rules="rules">
+      <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="点价价格"
-                         name="PricedPrice">
-              <a-input-number class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.PricedPrice"
-                              :min="0"
-                              placeholder="请输入点价价格" />
+            <a-form-item label="点价价格" name="PricedPrice">
+              <a-input-number class="dialogInput" style="width: 200px" v-model:value="formState.PricedPrice" :min="0" placeholder="请输入点价价格" />
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -119,21 +98,12 @@
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="点价数量"
-                         class="relative"
-                         name="PricedQty">
-              <a-input-number class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.PricedQty"
-                              :min="0"
-                              :max="selectedRow.unpricedqty"
-                              placeholder="请输入点价数量" />
+            <a-form-item label="点价数量" class="relative" name="PricedQty">
+              <a-input-number class="dialogInput" style="width: 200px" v-model:value="formState.PricedQty" :min="0" :max="selectedRow.unpricedqty" placeholder="请输入点价数量" />
               <div class="tip mt10">
-                <span>未定价量<span
-                        class="white">{{ selectedRow.unpricedqty }}{{ selectedRow.enumdicname }}</span>
+                <span>未定价量<span class="white">{{ selectedRow.unpricedqty }}{{ selectedRow.enumdicname }}</span>
                 </span>
-                <a class="blue ml10"
-                   @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</a>
+                <a class="blue ml10" @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</a>
               </div>
             </a-form-item>
           </a-col>
@@ -164,46 +134,46 @@ import { getPriceTypeName } from '@/common/constants/enumsName';
 import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
-    name: 'sell_pending_someprice',
-    emits: ['cancel', 'update'],
-    props: {
-        selectedRow: {
-            type: Object as PropType<Ermcp3SellBuyContract>,
-            default: {},
-        },
+  name: 'sell_pending_someprice',
+  emits: ['cancel', 'update'],
+  props: {
+    selectedRow: {
+      type: Object as PropType<Ermcp3SellBuyContract>,
+      default: {},
     },
-    setup(props, context) {
-        const { visible, cancel } = _closeModal(context);
-        const loading = ref<boolean>(false);
-        const { rules, formState, formRef } = handleForm();
-        function submit() {
-            const wrapEl = unref(formRef);
-            wrapEl.validate().then(() => {
-                loading.value = true;
-                const params: SomePriceReq = {
-                    PricedPrice: Number(formState.PricedPrice),
-                    PricedQty: Number(formState.PricedQty),
-                };
-                // 发出点价请求
-                somePriceReq(props.selectedRow.spotcontractid, params, loading)
-                    .then((res) => {
-                        cancel(true);
-                    })
-                    .catch((err) => {});
-            });
-        }
-        return {
-            visible,
-            cancel,
-            submit,
-            loading,
-            formRef,
-            formState,
-            formatValue,
-            rules,
-            getPriceTypeName,
+  },
+  setup(props, context) {
+    const { visible, cancel } = _closeModal(context);
+    const loading = ref<boolean>(false);
+    const { rules, formState, formRef } = handleForm();
+    function submit() {
+      const wrapEl = unref(formRef);
+      wrapEl.validate().then(() => {
+        loading.value = true;
+        const params: SomePriceReq = {
+          PricedPrice: Number(formState.PricedPrice),
+          PricedQty: Number(formState.PricedQty),
         };
-    },
+        // 发出点价请求
+        somePriceReq(props.selectedRow.spotcontractid, params, loading)
+          .then((res) => {
+            cancel(true);
+          })
+          .catch((err) => { });
+      });
+    }
+    return {
+      visible,
+      cancel,
+      submit,
+      loading,
+      formRef,
+      formState,
+      formatValue,
+      rules,
+      getPriceTypeName,
+    };
+  },
 });
 </script>
 

+ 28 - 5
src/views/business/sell/list/all/index.vue

@@ -8,7 +8,7 @@
       <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :rowKey="(record,index)=>index" :data-source="tableList">
         <!-- 额外的展开行 -->
         <template #expandedRowRender="{ record }">
-          <mtp-table-button class="btn-list-sticky" :buttons="buttons" :record="record" @click="openComponent" />
+          <mtp-table-button class="btn-list-sticky" :buttons="handleBtnList(record)" :record="record" @click="openComponent" />
         </template>
         <template #pricedqty="{ text, record }">
           <span>{{ handleEnumdic(text, record) }}</span>
@@ -16,9 +16,6 @@
         <template #unsureqty="{ text, record }">
           <span>{{ handleEnumdic(text, record) }}</span>
         </template>
-        <template #goodsid="{ text }">
-          <span>{{ text > 0 ? '期货' : '现货' }}</span>
-        </template>
         <template #qty="{ text, record }">
           <span>{{ handleEnumdic(text, record) }}</span>
         </template>
@@ -31,11 +28,23 @@
         <template #startdate,enddate="{ record }">
           <span>{{ formatValue(formatTime(record.startdate, 'd') + '--' + formatTime(record.enddate, 'd')) }}</span>
         </template>
+        <!-- 业务类型 -->
+        <template #biztype="{ text }">
+          <a>{{ getBizTypeName(text) }}</a>
+        </template>
+        <!-- 点价类型 -->
+        <template #goodsid="{ text }">
+          <span>{{ text > 0 ? '期货' : '现货' }}</span>
+        </template>
+        <!-- 定价类型 -->
+        <template #pricetype="{ text }">
+          <a>{{ getPriceTypeName(text) }}</a>
+        </template>
       </a-table>
     </template>
   </mtp-table-scroll>
   <!-- 右键 -->
-  <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="buttons"> </contextMenu>
+  <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="handleBtnList(selectedRow)"> </contextMenu>
   <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
 </template>
 
@@ -50,6 +59,7 @@ import { filterCustomTable } from '../../components';
 import { formatTime, formatValue } from '@/common/methods';
 import { getTableButton } from '@/common/setup/table/button';
 import { useRoute } from 'vue-router';
+import { getBizTypeName, getPriceTypeName } from '@/common/constants/enumsName';
 
 export default defineComponent({
   name: EnumRouterName.sell_pending,
@@ -102,6 +112,16 @@ export default defineComponent({
       }
     };
 
+    // 处理按钮显示
+    function handleBtnList(item: Ermcp3SellBuyContract) {
+      if (item) {
+        if (item.goodsid) {
+          return buttons;
+        }
+        return buttons.filter((e) => e.code !== 'sell_pending_trade');
+      }
+    }
+
     // 表格通用逻辑
     const param: ComposeTableParam = {
       queryFn: queryTableAction,
@@ -119,6 +139,9 @@ export default defineComponent({
       formatTime,
       formatValue,
       buttons,
+      handleBtnList,
+      getBizTypeName,
+      getPriceTypeName,
     };
   },
 });

+ 13 - 1
src/views/information/spot-contract/list/purchase/index.vue

@@ -58,6 +58,7 @@
 </template>
 
 <script lang="ts">
+import { computed } from 'vue'
 import MtpTableScroll from '@/common/components/tableScroll/index.vue';
 import { queryTableList, MtpTableButton, contextMenu, defineAsyncComponent, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
 import { filterCustomTable } from '../../components';
@@ -136,8 +137,19 @@ export default defineComponent({
       isDetail: true,
     };
 
+    const compose = handleComposeTable<Ermcp3ContractRsp>(param);
+    const columns = computed(() => {
+      return compose.columns.value.map((item) => {
+        if (item.dataIndex === 'negative') {
+          item.title = '销售方';
+        }
+        return item;
+      })
+    })
+
     return {
-      ...handleComposeTable<Ermcp3ContractRsp>(param),
+      ...compose,
+      columns,
       loading,
       tableList,
       getBizTypeName,

+ 13 - 1
src/views/information/spot-contract/list/sell/index.vue

@@ -58,6 +58,7 @@
 </template>
 
 <script lang="ts">
+import { computed } from 'vue'
 import MtpTableScroll from '@/common/components/tableScroll/index.vue';
 import { queryTableList, MtpTableButton, contextMenu, defineAsyncComponent, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
 import { filterCustomTable } from '../../components';
@@ -116,8 +117,19 @@ export default defineComponent({
       isDetail: true,
     };
 
+    const compose = handleComposeTable<Ermcp3ContractRsp>(param);
+    const columns = computed(() => {
+      return compose.columns.value.map((item) => {
+        if (item.dataIndex === 'negative') {
+          item.title = '采购方';
+        }
+        return item;
+      })
+    })
+
     return {
-      ...handleComposeTable<Ermcp3ContractRsp>(param),
+      ...compose,
+      columns,
       loading,
       tableList,
       getBizTypeName,

+ 2 - 2
src/views/manage/business-review/list/someprice/index.vue

@@ -91,10 +91,10 @@ export default defineComponent({
     // 获取表头名称
     const getTableName = () => {
       switch (routeName) {
-        // 业务审核
+        // 审核
         case 'someprice_checkpending':
           return 'table_pcweb_business_aduit_dj';
-        // 业务未审核
+        // 审核
         case 'someprice_performance':
           return 'table_pcweb_business_aduit_ydj';
       }

+ 1 - 1
src/views/manage/finance-review/list/invoice/index.vue

@@ -5,7 +5,7 @@
       <Filter @search="updateColumn"></Filter>
     </template>
     <template #default="{ scroll }">
-      <a-table :columns="columns" class="topTable" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :rowKey="(record,index)=>index" :scroll="scroll" :data-source="tableList">
+      <a-table :columns="columns" class="srcollYTable" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :rowKey="(record,index)=>index" :scroll="scroll" :data-source="tableList">
         <!-- 额外的展开行 -->
         <template #expandedRowRender="{ record }">
           <mtp-table-button class="btn-list-sticky" :buttons="handlePermissionBtn(buttons, record)" :record="record" @click="openComponent" />

+ 0 - 1
src/views/report/exposure-report/list/exposure_report/index.vue

@@ -33,7 +33,6 @@ import { qryAreaExpourseContractDetail, qryAreaExpourseFutuDetail, qryAreaExpour
 import { ComposeTableDetailParam, handleComposeTable_detail } from '@/common/setup/table/compose';
 import { ref, watch } from 'vue';
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { TabList } from '@/common/components/description/interface';
 import { getBizTypeName, getBuyOrSellName, getContractTypeName } from '@/common/constants/enumsName';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getTableButton } from '@/common/setup/table/button';

+ 1 - 1
src/views/report/finance-report/list/finance_report_finance/index.vue

@@ -92,7 +92,7 @@ export default defineComponent({
         userid: chaceSearchValue.value?.userid,
       };
       if (code === 'finance_report_finance_category_breakdown') {
-        // 品明细
+        // 品明细
         // 注册表头
         registerColumnDetail('table_pcweb_financial_statement_category_breakdown', []);
         param.sumfields = '1,2';

+ 43 - 55
src/views/report/spot-report/components/filterTable/index.vue

@@ -1,70 +1,58 @@
 <template>
-    <!-- 过滤客户资料表格 -->
-    <Filter @update="update" ref="filter" v-slot="{search,reset}">
-        <a-select label-in-value class="conditionSelect ml10" style="width: 120px" v-model:value="selectedDG" @change="DGChange" placeholder="全部现货品种">
-            <a-select-option v-for="item in DGList" :key="item.data.deliverygoodsname">
-                {{ item.data.deliverygoodsname }}
-            </a-select-option>
-        </a-select>
-        <a-select label-in-value class="conditionSelect ml10" style="width: 120px" v-model:value="selectedGM" @change="GBOrGMChange" placeholder="全部品类">
-            <a-select-option v-for="item in gmlist" :key="item.wrstandardname">
-                {{ item.wrstandardname }}
-            </a-select-option>
-        </a-select>
-        <a-select label-in-value class="conditionSelect ml10" style="width: 120px" v-model:value="selectedGB" @change="GBOrGMChange" placeholder="全部品牌">
-            <a-select-option v-for="item in gblist" :key="item.brandname">
-                {{ item.brandname }}
-            </a-select-option>
-        </a-select>
-        <a-button class="selectBtn">查询</a-button>
-        <a-button class="selectBtn" @click="resetAction(search,reset)">重置</a-button>
-    </Filter>
+  <!-- 过滤客户资料表格 -->
+  <Filter @update="update" ref="filter" v-slot="{search,reset}">
+    <a-select label-in-value class="conditionSelect ml10" style="width: 120px" v-model:value="selectedDG" @change="DGChange" placeholder="全部现货品种">
+      <a-select-option v-for="item in DGList" :key="item.data.deliverygoodsname">
+        {{ item.data.deliverygoodsname }}
+      </a-select-option>
+    </a-select>
+    <a-select label-in-value class="conditionSelect ml10" style="width: 120px" v-model:value="selectedGM" placeholder="全部商品">
+      <a-select-option v-for="item in gmlist" :key="item.wrstandardname">
+        {{ item.wrstandardname }}
+      </a-select-option>
+    </a-select>
+    <a-button class="selectBtn">查询</a-button>
+    <a-button class="selectBtn" @click="resetAction(search,reset)">重置</a-button>
+  </Filter>
 </template>
 
 <script lang="ts">
 import FilterOption from '@/common/components/filter/index.vue';
 import { defineComponent } from 'vue';
-import { ref ,onMounted } from 'vue';
-import { handleFilter, SelectList } from '@/common/setup/filter';
-import { handlerManagerList } from '@/common/setup/user';
-import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
-import { SelectOption } from '@/common/setup/filter/interface';
+import { ref, onMounted } from 'vue';
 import Filter from '../../../components/filter/index.vue';
 import { TypeAndTime } from '@/views/report/interface';
 import { handleDG } from '@/views/report/setup';
 
 export default defineComponent({
-    name: 'exposure-filter-table',
-    components: { FilterOption, Filter },
-    setup(props, context) {
-        function update(value: TypeAndTime) {
-            context.emit('update', value);
-        }
+  name: 'exposure-filter-table',
+  components: { FilterOption, Filter },
+  setup(props, context) {
+    function update(value: TypeAndTime) {
+      context.emit('update', value);
+    }
 
-        let filter = ref(null);
-        onMounted(()=>{
-        console.log(filter.value)
-        });
-        const { DGList, gblist, gmlist, selectedDG, selectedGB, selectedGM, DGChange, GBOrGMChange, reset } = handleDG(context);
-        function resetAction(search:Function,Nreset:Function) {
-            Nreset()
-            reset()
-        }
-        return {
-            filter,
-            DGList,
-            gblist,
-            gmlist,
-            DGChange,
-            GBOrGMChange,
-            reset,
-            selectedDG,
-            selectedGB,
-            selectedGM,
-            update,
-            resetAction,
-        };
-    },
+    let filter = ref(null);
+    onMounted(() => {
+      console.log(filter.value)
+    });
+    const { DGList, gmlist, selectedDG, selectedGM, DGChange, reset } = handleDG(context);
+    function resetAction(search: Function, Nreset: Function) {
+      Nreset()
+      reset()
+    }
+    return {
+      filter,
+      DGList,
+      gmlist,
+      DGChange,
+      reset,
+      selectedDG,
+      selectedGM,
+      update,
+      resetAction,
+    };
+  },
 });
 </script>
 

+ 2 - 2
src/views/report/spot-report/list/spot_report/index.vue

@@ -85,7 +85,6 @@ import { ref, watch } from 'vue';
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getTableButton } from '@/common/setup/table/button';
-import { columns } from './setup';
 import MtpTableDetail from '@/common/components/tableDetail/index.vue';
 
 export default defineComponent({
@@ -124,6 +123,7 @@ export default defineComponent({
       menuType: EnumRouterName.spot_report_spot, // 当前tab页对应的code
     };
     const {
+      columns,
       updateColumn, //  表头数据
       columnsDetail,
       registerColumnDetail,
@@ -189,9 +189,9 @@ export default defineComponent({
       loading,
       tableList,
       visible,
-      columns,
       updateColumn,
       search,
+      columns,
       columnsDetail,
       detailTableList,
       expandedRowKeys,

+ 0 - 198
src/views/report/spot-report/list/spot_report/setup.ts

@@ -1,198 +0,0 @@
-import { ColumnType } from '@/common/methods/table';
-
-/**
- * 表头对应字段
- */
-export const columns: ColumnType[] = [
-    {
-        "key": "0th",
-        "dataIndex": "accountname",
-        "title": "交易用户",
-        "align": "center",
-        "slots": {
-            "customRender": "accountname"
-        },
-        "width": 120
-    },
-    {
-        "key": "1th",
-        "dataIndex": "currencyname",
-        "title": "结算币种",
-        "align": "center",
-        "slots": {
-            "customRender": "currencyname"
-        },
-        "width": 120
-    },
-    {
-        "key": "2th",
-        "dataIndex": "deliverygoodsname",
-        "title": "现货品种",
-        "align": "center",
-        "slots": {
-            "customRender": "deliverygoodsname"
-        },
-        "width": 120,
-        "filteredValue": null
-    },
-    {
-        "key": "5th",
-        "dataIndex": "oriqty",
-        "title": "期初量",
-        "align": "center",
-        "slots": {
-            "customRender": "oriqty"
-        },
-        "width": 120
-    },
-    {
-        "key": "6th",
-        "dataIndex": "oriamount",
-        "title": "期初额",
-        "align": "center",
-        "slots": {
-            "customRender": "oriamount"
-        },
-        "width": 120
-    },
-    {
-        "key": "7th",
-        "dataIndex": "oriaverageprice",
-        "title": "期初均价",
-        "align": "center",
-        "slots": {
-            "customRender": "oriaverageprice"
-        },
-        "width": 120
-    },
-    {
-        "key": "8th",
-        "dataIndex": "todaybuyqty",
-        "title": "今采购量",
-        "align": "center",
-        "slots": {
-            "customRender": "todaybuyqty"
-        },
-        "width": 120
-    },
-    {
-        "key": "9th",
-        "dataIndex": "todaybuyamount",
-        "title": "今采购额",
-        "align": "center",
-        "slots": {
-            "customRender": "todaybuyamount"
-        },
-        "width": 120
-    },
-    {
-        "key": "10th",
-        "dataIndex": "todaybuyaverageprice",
-        "title": "采购均价",
-        "align": "center",
-        "slots": {
-            "customRender": "todaybuyaverageprice"
-        },
-        "width": 120
-    },
-    {
-        "key": "11th",
-        "dataIndex": "todaysellqty",
-        "title": "今销售量",
-        "align": "center",
-        "slots": {
-            "customRender": "todaysellqty"
-        },
-        "width": 120
-    },
-    {
-        "key": "12th",
-        "dataIndex": "todaysellamount",
-        "title": "今销售额",
-        "align": "center",
-        "slots": {
-            "customRender": "todaysellamount"
-        },
-        "width": 120
-    },
-    {
-        "key": "13th",
-        "dataIndex": "todaysellaverageprice",
-        "title": "销售均价",
-        "align": "center",
-        "slots": {
-            "customRender": "todaysellaverageprice"
-        },
-        "width": 120
-    },
-    {
-        "key": "14th",
-        "dataIndex": "curqty",
-        "title": "期末量",
-        "align": "center",
-        "slots": {
-            "customRender": "curqty"
-        },
-        "width": 120
-    },
-    {
-        "key": "15th",
-        "dataIndex": "curamount",
-        "title": "期末额",
-        "align": "center",
-        "slots": {
-            "customRender": "curamount"
-        },
-        "width": 120
-    },
-    {
-        "key": "16th",
-        "dataIndex": "curaverageprice",
-        "title": "期末均价",
-        "align": "center",
-        "slots": {
-            "customRender": "curaverageprice"
-        },
-        "width": 120
-    },
-    {
-        "key": "17th",
-        "dataIndex": "actualpl",
-        "title": "现货损益",
-        "align": "center",
-        "slots": {
-            "customRender": "actualpl"
-        },
-        "width": 120
-    },
-    {
-        "key": "18th",
-        "dataIndex": "curspotprice",
-        "title": "最新价",
-        "align": "center",
-        "slots": {
-            "customRender": "curspotprice"
-        },
-        "width": 120
-    },
-    {
-        "key": "19th",
-        "dataIndex": "curmarketvalue",
-        "title": "期末市值",
-        "align": "center",
-        "slots": {
-            "customRender": "curmarketvalue"
-        },
-        "width": 120
-    },
-    {
-        "key": "20th",
-        "dataIndex": "floatpl",
-        "title": "浮动损益",
-        "align": "center",
-        "slots": {
-            "customRender": "floatpl"
-        },
-        "width": 120
-    }
-];

+ 6 - 18
src/views/report/sum_pl_report/list/sum_pl_report/index.vue

@@ -3,26 +3,14 @@
   <!-- 汇总损益报表 -->
   <mtp-table-scroll>
     <template #default="{ scroll }">
-      <a-table :columns="getColumns()" class="srcollYTable" :scroll="scroll" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :rowKey="(record,index)=>index" :data-source="tableList"></a-table>
+      <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :rowKey="(record,index)=>index" :data-source="tableList"></a-table>
     </template>
   </mtp-table-scroll>
   <!-- 明细,日报表不显示“损益明细“标签页 -->
   <mtp-table-detail :columns="columnsDetail" :data-source="detailTableList" :tabs="tabList" v-model:visible="visible" @change="changeTab" v-show="cycletype > 0">
-    <!-- 出现浮点失真  强行处理 * 2-->
-    <template #spotactualpl="{ record }">
-      <span>{{ record.spotactualpl.toFixed(2) }}</span>
-    </template>
-    <template #spotfloatpl="{ record }">
-      <span>{{ record.spotfloatpl.toFixed(2) }}</span>
-    </template>
-    <template #futureactualpl="{ record }">
-      <span>{{ record.futureactualpl.toFixed(2) }}</span>
-    </template>
-    <template #sumactualpl="{ record }">
-      <span>{{ record.sumactualpl.toFixed(2) }}</span>
-    </template>
-    <template #sumpl="{ record }">
-      <span>{{ record.sumpl.toFixed(2) }}</span>
+    <!-- 期现比例 -->
+    <template #futurespotratio="{ record }">
+      <span>{{ (record.futurespotratio * 100) + '%' }}</span>
     </template>
   </mtp-table-detail>
 </template>
@@ -40,7 +28,6 @@ import { TypeAndTime } from '@/views/report/interface';
 import { handleInitTypeAndTime } from '@/views/report/setup';
 import { ref, watch } from 'vue';
 import Filter from '../../components/filterTable/index.vue';
-import { getColumns } from './setup';
 import MtpTableDetail from '@/common/components/tableDetail/index.vue';
 
 export default defineComponent({
@@ -81,6 +68,7 @@ export default defineComponent({
       menuType: EnumRouterName.sum_pl_report_sum_pl, // 当前tab页对应的code
     };
     const {
+      columns,
       updateColumn, //  表头数据
       columnsDetail,
       registerColumnDetail,
@@ -147,9 +135,9 @@ export default defineComponent({
       loading,
       tableList,
       visible,
-      getColumns,
       updateColumn,
       search,
+      columns,
       columnsDetail,
       detailTableList,
       expandedRowKeys,

+ 0 - 80
src/views/report/sum_pl_report/list/sum_pl_report/setup.ts

@@ -1,80 +0,0 @@
-import { Ermcp3ArealSumPL } from '@/services/go/ermcp/report/interface';
-
-export function getColumns() {
-    const columns = [
-        {
-            title: '结算币种',
-            key: 'currencyname',
-        },
-        {
-            title: '交易用户',
-            key: 'accountname',
-        },
-        {
-            title: '套保品种',
-            key: 'middlegoodsname',
-        },
-        {
-            title: '单位',
-            key: 'enumdicname',
-        },
-        {
-            title: '现货总量',
-            key: 'totalspotqty',
-        },
-        {
-            title: '计划套保量',
-            key: 'totalneedhedgeqty',
-            width: 130,
-        },
-        {
-            title: '期货持仓量',
-            key: 'totalfutureqty',
-            width: 130,
-        },
-        {
-            title: '期现比例',
-            key: 'futurespotratio',
-            customRender: ({ record }: { record: Ermcp3ArealSumPL }) => {
-                return (record.futurespotratio * 100) + '%';
-            }
-        },
-        {
-            title: '现货损益',
-            key: 'spotactualpl',
-        },
-        {
-            title: '现货浮动损益',
-            key: 'spotfloatpl',
-            width: 130,
-        },
-        {
-            title: '期货损益',
-            key: 'futureactualpl',
-        },
-        {
-            title: '期货浮动损益',
-            key: 'futurefloatpl',
-            width: 130,
-        },
-        {
-            title: '总敞口损益',
-            key: 'sumpl',
-            width: 130,
-        },
-        {
-            title: '套保敞口损益',
-            key: 'hedgeexposurepl',
-            width: 130,
-        },
-    ];
-
-    return columns.map(el => {
-        return {
-            dataIndex: el.key,
-            width: 100,
-            align: 'center',
-            ...el
-        }
-    })
-}

+ 6 - 1
src/views/search/inventory/list/inventory_current/index.vue

@@ -7,7 +7,12 @@
       </Filter>
     </template>
     <template #default="{ scroll }">
-      <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :pagination="false" :rowKey="(record,index)=>index" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList"></a-table>
+      <a-table :columns="columns" class="srcollYTable" :scroll="scroll" :pagination="false" :rowKey="(record,index)=>index" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList">
+        <!-- 今日变动 = 今日入库量 - 今日出库量 -->
+        <template #diffqty="{ record }">
+          <a>{{ record.todayproduceinqty - record.todayproduceoutqty }}</a>
+        </template>
+      </a-table>
     </template>
   </mtp-table-scroll>
   <!-- 明细 -->