|
|
@@ -1,97 +1,83 @@
|
|
|
<template>
|
|
|
<!-- 委托记录 - 商品合约 - 历史记录-->
|
|
|
- <div class="topTableHeight">
|
|
|
+ <section class="topTableHeight">
|
|
|
<a-table
|
|
|
- :columns="tabColumns"
|
|
|
+ :columns="columns"
|
|
|
class="srcollYTable"
|
|
|
- :scroll="{ x: '100%', y: 'calc(100vh - 405px)' }"
|
|
|
+ :scroll="{ x: '100%', y: '190px' }"
|
|
|
:pagination="false"
|
|
|
:loading="loading"
|
|
|
:expandedRowKeys="expandedRowKeys"
|
|
|
:customRow="Rowclick"
|
|
|
+ :expandIcon="expandIcon"
|
|
|
+ :expandIconAsCell="false"
|
|
|
rowKey="key"
|
|
|
:data-source="tableList"
|
|
|
>
|
|
|
- <template #createtime="{ record }">
|
|
|
- <a>{{ formatTime(record.createtime) }}</a>
|
|
|
+ <!-- 类型 -->
|
|
|
+ <template #buildtype="{ record }">
|
|
|
+ <a>{{ getBuyOrSellTypeName(record.buyorsell) }}</a>
|
|
|
</template>
|
|
|
- <template #buyorsell="{ record }">
|
|
|
- <span>{{ getBuyOrSellName(record.buyorsell) }}</span>
|
|
|
+ <!-- 状态 -->
|
|
|
+ <template #orderstatus="{ record }">
|
|
|
+ <a>{{ getOrderStatusName(record.orderstatus) }}</a>
|
|
|
</template>
|
|
|
- <template #marketamount="{ record, text }">
|
|
|
- <span>{{ isDiaoQi(record) ? '--' : text }}</span>
|
|
|
+
|
|
|
+ <template #ordertime="{ text }">
|
|
|
+ <a>{{ formatTime(text) }}</a>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
- </div>
|
|
|
+ </section>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
import { TradeMode } from '@/common/constants/enumCommon';
|
|
|
-import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
-import { getBuyOrSellName } from '@/common/constants/enumsName';
|
|
|
-import { ComposeTableParam, defineComponent, queryTableList } from '@/common/export/commonTable';
|
|
|
+import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
|
|
|
+import { getBuyOrSellTypeName, getOrderStatusName } from '@/common/constants/enumsName';
|
|
|
+import { 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 { handleSubcriteQuote } from '@/common/setup/table/tableQuote';
|
|
|
-import { findGoodsTradeModeById, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
|
|
|
-import { useProfitloss } from '@/services/bus/holdPosition';
|
|
|
+import { handleComposeOrderTable } from '@/common/setup/table/compose';
|
|
|
+import { ComposeOrderTableParam } from '@/common/setup/table/interface';
|
|
|
import { queryHisTradeOrderDetail } from '@/services/go/ermcp/order';
|
|
|
-import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
|
|
|
-import { QueryQuoteGoodsListRsp } from '@/services/go/Tjmd/interface';
|
|
|
-import { handleComposeTable } from '@/views/market/spot_trade/setup';
|
|
|
-import { findGoodsCode, tabColumns } from '@/views/order/commodity_contract/components/commodity_contract_summary/setup';
|
|
|
+import { QueryTradeOrderDetailRsp } from '@/services/go/ermcp/order/interface';
|
|
|
+import { WrPerformancePlan } from '@/services/go/wrtrade/interface';
|
|
|
import moment from 'moment';
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
|
export default defineComponent({
|
|
|
+ name: enumOrderComponents.commodity_contract_commission,
|
|
|
setup() {
|
|
|
// 表格列表数据
|
|
|
- const { loading, tableList, queryTable } = queryTableList<QueryTradePositionRsp>();
|
|
|
- const { subscribeAction } = handleSubcriteQuote();
|
|
|
- const swapList = ref<QueryQuoteGoodsListRsp[]>([]);
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<QueryTradeOrderDetailRsp>();
|
|
|
// 获取列表数据
|
|
|
const queryTableAction = () => {
|
|
|
- const startDate = moment().format("YYYY-MM-DD")
|
|
|
- const endDate = moment().add(-1, 'm').format("YYYY-MM-DD")
|
|
|
- queryTable(queryHisTradeOrderDetail, { startDate, endDate })
|
|
|
- };
|
|
|
- // 现价
|
|
|
- function getLastprice(record: QueryTradePositionRsp) {
|
|
|
- let result: number | string = '--';
|
|
|
- const goodscode = findGoodsCode(record.goodsid, record.goodscode, swapList.value);
|
|
|
- if (goodscode) {
|
|
|
- result = getQuoteDayInfoByCodeFindPrice(goodscode);
|
|
|
+ const param = {
|
|
|
+ endDate: moment().format("YYYY-MM-DD"),
|
|
|
+ startDate: moment().subtract(2, 'months').startOf('month').format("YYYY-MM-DD"),
|
|
|
+ tradeMode: TradeMode.DiaoQi.toString()
|
|
|
}
|
|
|
- return result;
|
|
|
- }
|
|
|
- function isDiaoQi(record: QueryTradePositionRsp) {
|
|
|
- return findGoodsTradeModeById(record.goodsid) === TradeMode.DiaoQi;
|
|
|
- }
|
|
|
+ queryTable(queryHisTradeOrderDetail, param);
|
|
|
+ };
|
|
|
// 表格通用逻辑
|
|
|
- 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(),
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
- ...handleComposeTable<QueryTradePositionRsp>(param),
|
|
|
+ ...handleComposeOrderTable<WrPerformancePlan>(param),
|
|
|
loading,
|
|
|
tableList,
|
|
|
- tabColumns,
|
|
|
formatTime,
|
|
|
- getLastprice,
|
|
|
- useProfitloss,
|
|
|
- findGoodsCode,
|
|
|
- swapList,
|
|
|
- getBuyOrSellName,
|
|
|
- isDiaoQi,
|
|
|
expandIcon,
|
|
|
+ getBuyOrSellTypeName,
|
|
|
+ getOrderStatusName,
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
|
+
|
|
|
<style lang="less">
|
|
|
-</style>
|
|
|
+</style>;
|