huangbin 4 лет назад
Родитель
Сommit
964039c6b1

+ 1 - 126
src/views/order/commodity_contract/components/commodity_contract_settlement/index.vue

@@ -59,132 +59,7 @@ import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { queryWrDeliveryDetail } from '@/services/go/wrtrade';
 import { WrDeliveryDetail } from '@/services/go/wrtrade/interface';
 import Bus from '@/utils/eventBus/index';
-
-const useColumns = () => {
-    const columns = [
-        {
-            key: '0th',
-            dataIndex: 'xgoodsname',
-            title: '订单合约',
-            align: 'center',
-            slots: {
-                customRender: 'xgoodsname',
-            },
-            width: 120,
-        },
-        {
-            key: '1th',
-            dataIndex: 'buyorsell',
-            title: '类型',
-            align: 'center',
-            slots: {
-                customRender: 'buyorsell',
-            },
-            width: 120,
-        },
-        {
-            key: '2th',
-            dataIndex: 'xdeliverycloseqty',
-            title: '合同数量',
-            align: 'center',
-            slots: {
-                customRender: 'xdeliverycloseqty',
-            },
-            width: 120,
-        },
-        {
-            key: '3th',
-            dataIndex: 'xgoodsamount',
-            title: '合约金额',
-            align: 'center',
-            slots: {
-                customRender: 'xgoodsamount',
-            },
-            width: 120,
-        },
-        {
-            key: '4th',
-            dataIndex: 'deliveryqty',
-            title: '点选数量',
-            align: 'center',
-            slots: {
-                customRender: 'deliveryqty',
-            },
-            width: 120,
-        },
-        {
-            key: '5th',
-            dataIndex: 'pdeliveryprice',
-            title: '点价价格',
-            align: 'center',
-            slots: {
-                customRender: 'pdeliveryprice',
-            },
-            width: 120,
-        },
-        {
-            key: '6th',
-            dataIndex: 'p1goodsremainamount',
-            title: '点价货款',
-            align: 'center',
-            slots: {
-                customRender: 'p1goodsremainamount',
-            },
-            width: 120,
-        },
-        {
-            key: '7th',
-            dataIndex: 'deliverypricemove',
-            title: '升贴水',
-            align: 'center',
-            slots: {
-                customRender: 'deliverypricemove',
-            },
-            width: 120,
-        },
-        {
-            key: '8th',
-            dataIndex: 'deliverytotalamount',
-            title: '交收金额',
-            align: 'center',
-            slots: {
-                customRender: 'deliverytotalamount',
-            },
-            width: 120,
-        },
-        {
-            key: '9th',
-            dataIndex: 'averageprice',
-            title: '交收均价',
-            align: 'center',
-            slots: {
-                customRender: 'averageprice',
-            },
-            width: 120,
-        },
-        {
-            key: '10th',
-            dataIndex: 'deliverytime',
-            title: '申请时间',
-            align: 'center',
-            slots: {
-                customRender: 'deliverytime',
-            },
-            width: 200,
-        },
-        {
-            key: '11th',
-            dataIndex: 'deliverystatus',
-            title: '状态',
-            align: 'center',
-            slots: {
-                customRender: 'deliverystatus',
-            },
-            width: 120,
-        },
-    ];
-    return { columns };
-};
+import { useColumns } from '@/views/order/commodity_contract/components/commodity_contract_settlement/setup';
 
 export default defineComponent({
     name: enumOrderComponents.commodity_contract_settlement,

+ 125 - 0
src/views/order/commodity_contract/components/commodity_contract_settlement/setup.ts

@@ -0,0 +1,125 @@
+export const useColumns = () => {
+    const columns = [
+        {
+            key: '0th',
+            dataIndex: 'xgoodsname',
+            title: '订单合约',
+            align: 'center',
+            slots: {
+                customRender: 'xgoodsname',
+            },
+            width: 120,
+        },
+        {
+            key: '1th',
+            dataIndex: 'buyorsell',
+            title: '类型',
+            align: 'center',
+            slots: {
+                customRender: 'buyorsell',
+            },
+            width: 120,
+        },
+        {
+            key: '2th',
+            dataIndex: 'xdeliverycloseqty',
+            title: '合同数量',
+            align: 'center',
+            slots: {
+                customRender: 'xdeliverycloseqty',
+            },
+            width: 120,
+        },
+        {
+            key: '3th',
+            dataIndex: 'xgoodsamount',
+            title: '合约金额',
+            align: 'center',
+            slots: {
+                customRender: 'xgoodsamount',
+            },
+            width: 120,
+        },
+        {
+            key: '4th',
+            dataIndex: 'deliveryqty',
+            title: '点选数量',
+            align: 'center',
+            slots: {
+                customRender: 'deliveryqty',
+            },
+            width: 120,
+        },
+        {
+            key: '5th',
+            dataIndex: 'pdeliveryprice',
+            title: '点价价格',
+            align: 'center',
+            slots: {
+                customRender: 'pdeliveryprice',
+            },
+            width: 120,
+        },
+        {
+            key: '6th',
+            dataIndex: 'p1goodsremainamount',
+            title: '点价货款',
+            align: 'center',
+            slots: {
+                customRender: 'p1goodsremainamount',
+            },
+            width: 120,
+        },
+        {
+            key: '7th',
+            dataIndex: 'deliverypricemove',
+            title: '升贴水',
+            align: 'center',
+            slots: {
+                customRender: 'deliverypricemove',
+            },
+            width: 120,
+        },
+        {
+            key: '8th',
+            dataIndex: 'deliverytotalamount',
+            title: '交收金额',
+            align: 'center',
+            slots: {
+                customRender: 'deliverytotalamount',
+            },
+            width: 120,
+        },
+        {
+            key: '9th',
+            dataIndex: 'averageprice',
+            title: '交收均价',
+            align: 'center',
+            slots: {
+                customRender: 'averageprice',
+            },
+            width: 120,
+        },
+        {
+            key: '10th',
+            dataIndex: 'deliverytime',
+            title: '申请时间',
+            align: 'center',
+            slots: {
+                customRender: 'deliverytime',
+            },
+            width: 200,
+        },
+        {
+            key: '11th',
+            dataIndex: 'deliverystatus',
+            title: '状态',
+            align: 'center',
+            slots: {
+                customRender: 'deliverystatus',
+            },
+            width: 120,
+        },
+    ];
+    return { columns };
+};

+ 65 - 34
src/views/search/search_document_records/search_commodity_contract/search_document_records_commission_record/index.vue

@@ -1,56 +1,87 @@
 <template>
-    <!-- 单据记录 商品合约-->
-    <div class="topTableHeight">
-        <a-table
-            :columns="columns"
-            class="srcollYTable"
-            :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        ></a-table>
-    </div>
+  <!-- 商品订单 - 委托 -->
+  <div class="topTableHeight">
+    <a-table :columns="columns"
+             class="srcollYTable"
+             :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 类型 -->
+      <template #buildtype="{ record }">
+        <a>{{ getBuyOrSellTypeName(record.buyorsell) }}</a>
+      </template>
+      <!-- 状态 -->
+      <template #orderstatus="{ record }">
+        <a>{{ getOrderStatusName(record.orderstatus) }}</a>
+      </template>
+
+      <template #ordertime="{ text }">
+        <a>{{ formatTime(text) }}</a>
+      </template>
+    </a-table>
+  </div>
 </template>
 
 <script lang="ts">
-import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { queryTableList, defineComponent, ComposeTableParam } from '@/common/export/commonTable';
-import { QueryOrderQuoteReq, WrOrderQuote } from '@/services/go/wrtrade/interface';
-import { queryOrderQuote } from '@/services/go/wrtrade';
-import { handleComposeTable } from '@/views/market/spot_trade/setup';
+import { BtnListType } from '@/common/components/btnList/interface';
+import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
+import { getBuyOrSellTypeName, getOrderStatusName } from '@/common/constants/enumsName';
+import { BtnList, defineAsyncComponent, defineComponent, queryTableList } from '@/common/export/commonTable';
+import { formatTime } from '@/common/methods';
+import { getRecordItemTab } from '@/common/setup/order/orderData';
+import { expandIcon } from '@/common/setup/table/clolumn';
+import { handleComposeOrderTable } from '@/common/setup/table/compose';
+import { ComposeOrderTableParam } from '@/common/setup/table/interface';
+import { queryTradeOrderDetail } from '@/services/go/ermcp/order';
+import { QueryTradeOrderDetailRsp } from '@/services/go/ermcp/order/interface';
+import { WrPerformancePlan } from '@/services/go/wrtrade/interface';
+import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
-    name: EnumRouterName.search_document_records_commission_record,
+    name: enumOrderComponents.commodity_contract_commission,
     setup() {
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<WrOrderQuote>();
+        const { loading, tableList, queryTable } = queryTableList<QueryTradeOrderDetailRsp>();
         // 获取列表数据
         const queryTableAction = () => {
-            const param: QueryOrderQuoteReq = {
-                wrpricetype: 1,
-                haswr: 0,
-            };
-            queryTable(queryOrderQuote, param);
+            queryTable(queryTradeOrderDetail, {});
         };
         // 表格通用逻辑
-        const param: ComposeTableParam = {
+        const param: ComposeOrderTableParam = {
             queryFn: queryTableAction,
-            menuType: EnumRouterName.warehouse_pre_sale_price,
-            tableName: 'table_pcweb_spot_trade_warehouse_sale_price',
-            tableFilterKey: [],
-            isDetail: false,
+            tableName: 'table_pcweb_spot_trade_bottom_commodity_contract_commission',
+            recordList: getRecordItemTab(),
         };
-
+        function filterBtnList(list: BtnListType[], record: QueryTradeOrderDetailRsp) {
+            //委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 1number;
+            const arr = [3, 7];
+            if (!arr.includes(record.orderstatus)) {
+                return list.filter((e) => e.code !== 'commodity_contract_commission_cancel_order');
+            } else {
+                return list;
+            }
+        }
+        // 挂牌
+        Bus.$on('spotTrade', () => {
+            queryTableAction();
+        });
         return {
-            ...handleComposeTable<WrOrderQuote>(param),
+            ...handleComposeOrderTable<WrPerformancePlan>(param),
             loading,
             tableList,
+            formatTime,
+            expandIcon,
+            getBuyOrSellTypeName,
+            getOrderStatusName,
+            filterBtnList,
         };
     },
 });
 </script>
+
 <style lang="less">
-</style>
+</style>;

+ 2 - 0
src/views/search/search_document_records/search_commodity_contract/search_document_records_contract_summary/index.vue

@@ -51,6 +51,7 @@ import { handleComposeTable } from '@/views/market/spot_trade/setup';
 import { getSwapList } from '@/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/setup';
 import { findGoodsCode, tabColumns } from '@/views/order/commodity_contract/components/commodity_contract_summary/setup';
 import { ref } from 'vue';
+import { expandIcon } from '@/common/setup/table/clolumn';
 
 export default defineComponent({
     name: EnumRouterName.search_document_records_contract_summary,
@@ -109,6 +110,7 @@ export default defineComponent({
             swapList,
             getBuyOrSellName,
             isDiaoQi,
+            expandIcon,
         };
     },
 });

+ 62 - 34
src/views/search/search_document_records/search_commodity_contract/search_document_records_delivery_record/index.vue

@@ -1,56 +1,84 @@
 <template>
-    <!-- 单据记录 商品合约-->
-    <div class="topTableHeight">
-        <a-table
-            :columns="columns"
-            class="srcollYTable"
-            :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        ></a-table>
-    </div>
+  <!-- 商品订单 - 交收 -->
+  <div class="topTableHeight">
+    <a-table :columns="columns"
+             class="srcollYTable"
+             :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <template #createtime="{ record }">
+        <span>{{ formatTime(record.createtime) }}</span>
+      </template>
+      <!-- 点价价格  x+c 交收模式,不显示价格-->
+      <template #pdeliveryprice="{ record }">
+        <span>{{ record.pgoodsid ? record.pdeliveryprice : '--' }}</span>
+      </template>
+      <!-- 点价货款  x+c 交收模式,不显示点价货款-->
+      <template #p1goodsremainamount="{ record }">
+        <span>{{ record.pgoodsid ? record.p1goodsremainamount : '--' }}</span>
+      </template>
+      <!-- 类型 -->
+      <template #buyorsell="{ text }">
+        <span>{{ getBuyOrSellName(text) }}</span>
+      </template>
+      <!-- 状态 -->
+      <template #deliverystatus="{ record }">
+        <a>{{ getDeliveryStatusName(record.deliverystatus) }}</a>
+      </template>
+    </a-table>
+  </div>
 </template>
 
 <script lang="ts">
-import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { queryTableList, defineComponent, ComposeTableParam } from '@/common/export/commonTable';
-import { QueryOrderQuoteReq, WrOrderQuote } from '@/services/go/wrtrade/interface';
-import { queryOrderQuote } from '@/services/go/wrtrade';
-import { handleComposeTable } from '@/views/market/spot_trade/setup';
+import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
+import { getBuildTypeName, getBuyOrSellName, getDeliveryStatusName } from '@/common/constants/enumsName';
+import { BtnList, defineComponent, queryTableList } from '@/common/export/commonTable';
+import { formatTime } from '@/common/methods';
+import { getRecordItemTab } from '@/common/setup/order/orderData';
+import { expandIcon } from '@/common/setup/table/clolumn';
+import { handleComposeOrderTable } from '@/common/setup/table/compose';
+import { ComposeOrderTableParam } from '@/common/setup/table/interface';
+import { queryWrDeliveryDetail } from '@/services/go/wrtrade';
+import { WrDeliveryDetail } from '@/services/go/wrtrade/interface';
+import Bus from '@/utils/eventBus/index';
+import { useColumns } from '@/views/order/commodity_contract/components/commodity_contract_settlement/setup';
 
 export default defineComponent({
-    name: EnumRouterName.search_document_records_delivery_record,
+    name: enumOrderComponents.commodity_contract_settlement,
     setup() {
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<WrOrderQuote>();
+        const { loading, tableList, queryTable } = queryTableList<WrDeliveryDetail>(true);
         // 获取列表数据
         const queryTableAction = () => {
-            const param: QueryOrderQuoteReq = {
-                wrpricetype: 1,
-                haswr: 0,
-            };
-            queryTable(queryOrderQuote, param);
+            queryTable(queryWrDeliveryDetail);
         };
         // 表格通用逻辑
-        const param: ComposeTableParam = {
+        const param: ComposeOrderTableParam = {
             queryFn: queryTableAction,
-            menuType: EnumRouterName.warehouse_pre_sale_price,
-            tableName: 'table_pcweb_spot_trade_warehouse_sale_price',
-            tableFilterKey: [],
-            isDetail: false,
+            // tableName: 'table_pcweb_spot_trade_bottom_commodity_contract_settlement',
+            recordList: getRecordItemTab(),
         };
-
+        Bus.$on('spotTrade', () => {
+            queryTableAction();
+        });
         return {
-            ...handleComposeTable<WrOrderQuote>(param),
+            ...handleComposeOrderTable<WrDeliveryDetail>(param),
+            ...useColumns(),
             loading,
             tableList,
+            formatTime,
+            expandIcon,
+            getBuildTypeName,
+            getDeliveryStatusName,
+            getBuyOrSellName,
         };
     },
 });
 </script>
+
 <style lang="less">
-</style>
+</style>;

+ 56 - 34
src/views/search/search_document_records/search_commodity_contract/search_document_records_transaction_record/index.vue

@@ -1,56 +1,78 @@
 <template>
-    <!-- 单据记录 商品合约-->
-    <div class="topTableHeight">
-        <a-table
-            :columns="columns"
-            class="srcollYTable"
-            :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        ></a-table>
-    </div>
+  <!-- 商品订单 - 成交 -->
+  <div class="topTableHeight">
+    <a-table :columns="columns"
+             class="srcollYTable"
+             :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 类型 -->
+      <template #buyorsell="{ text }">
+        <span>{{ getBuyOrSellTypeName(text) }}</span>
+      </template>
+      <!-- 状态 -->
+      <template #orderstatus="{ record }">
+        <a>{{ getOrderStatusName(record.orderstatus) }}</a>
+      </template>
+      <template #createtime="{ record }">
+        <a>{{ formatTime(record.createtime) }}</a>
+      </template>
+    </a-table>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
-import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { queryTableList, defineComponent, ComposeTableParam } from '@/common/export/commonTable';
-import { QueryOrderQuoteReq, WrOrderQuote } from '@/services/go/wrtrade/interface';
-import { queryOrderQuote } from '@/services/go/wrtrade';
-import { handleComposeTable } from '@/views/market/spot_trade/setup';
+import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
+import { getBuildTypeName, getBuyOrSellTypeName, getOrderStatusName } from '@/common/constants/enumsName';
+import { BtnList, defineComponent, queryTableList } from '@/common/export/commonTable';
+import { formatTime } from '@/common/methods';
+import { getRecordItemTab } from '@/common/setup/order/orderData';
+import { expandIcon } from '@/common/setup/table/clolumn';
+import { handleComposeOrderTable } from '@/common/setup/table/compose';
+import { ComposeOrderTableParam } from '@/common/setup/table/interface';
+import { queryTradeDetail } from '@/services/go/ermcp/order';
+import { QueryTradeDetailRsp } from '@/services/go/ermcp/order/interface';
+import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
-    name: EnumRouterName.search_document_records_transaction_record,
+    name: enumOrderComponents.commodity_contract_make_deal,
     setup() {
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<WrOrderQuote>();
+        const { loading, tableList, queryTable } = queryTableList<QueryTradeDetailRsp>();
         // 获取列表数据
         const queryTableAction = () => {
-            const param: QueryOrderQuoteReq = {
-                wrpricetype: 1,
-                haswr: 0,
-            };
-            queryTable(queryOrderQuote, param);
+            queryTable(queryTradeDetail, {});
         };
         // 表格通用逻辑
-        const param: ComposeTableParam = {
+        const param: ComposeOrderTableParam = {
             queryFn: queryTableAction,
-            menuType: EnumRouterName.warehouse_pre_sale_price,
-            tableName: 'table_pcweb_spot_trade_warehouse_sale_price',
-            tableFilterKey: [],
-            isDetail: false,
+            tableName: 'table_pcweb_spot_trade_bottom_commodity_contract_make_deal',
+            recordList: getRecordItemTab(),
         };
-
+        Bus.$on('spotTrade', () => {
+            queryTableAction();
+        });
         return {
-            ...handleComposeTable<WrOrderQuote>(param),
+            ...handleComposeOrderTable<QueryTradeDetailRsp>(param),
             loading,
             tableList,
+            formatTime,
+            expandIcon,
+            getBuildTypeName,
+            getOrderStatusName,
+            getBuyOrSellTypeName,
         };
     },
 });
 </script>
+
 <style lang="less">
-</style>
+</style>;