|
@@ -39,7 +39,8 @@
|
|
|
<div class="last">{{selectedRow.buyqty}}</div>
|
|
<div class="last">{{selectedRow.buyqty}}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="market">
|
|
|
|
|
|
|
+ <div class="market"
|
|
|
|
|
+ v-if="isFloatPrice()">
|
|
|
<div class="first">{{selectedRow.goodscode}}</div>
|
|
<div class="first">{{selectedRow.goodscode}}</div>
|
|
|
<div class="last red">{{getGoodsPrice()}}</div>
|
|
<div class="last red">{{getGoodsPrice()}}</div>
|
|
|
<LineChartOutlined />
|
|
<LineChartOutlined />
|
|
@@ -47,8 +48,6 @@
|
|
|
<BtnList :btnList="firstBtn"
|
|
<BtnList :btnList="firstBtn"
|
|
|
:record="selectedRow"
|
|
:record="selectedRow"
|
|
|
@click="openComponent" />
|
|
@click="openComponent" />
|
|
|
- <!-- <a-button class="publishBuy">发布求购</a-button>
|
|
|
|
|
- <a-button class="detailBtn">详情</a-button> -->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
<a-row>
|
|
<a-row>
|
|
|
<a-col :span="12"
|
|
<a-col :span="12"
|
|
@@ -75,20 +74,19 @@
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
-import { ComposeTableParam, defineAsyncComponent, defineComponent, BtnList, handleComposeTable, ModalEnum, queryTableList } from '@/common/export/commonTable';
|
|
|
|
|
|
|
+import { defineAsyncComponent, defineComponent, BtnList, ModalEnum } from '@/common/export/commonTable';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
-import { queryOrderQuoteDetail } from '@/services/go/wrtrade';
|
|
|
|
|
-import { QueryOrderQuoteDetailReq, WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
|
|
|
|
|
|
|
+import { WrOrderQuote } from '@/services/go/wrtrade/interface';
|
|
|
import { LeftOutlined } from '@ant-design/icons-vue';
|
|
import { LeftOutlined } from '@ant-design/icons-vue';
|
|
|
-import { handleBuyAndSellList, handleChildComponentMethod } from './setup';
|
|
|
|
|
|
|
+import { handleChildComponentMethod } from './setup';
|
|
|
import Buy from './components/buy/index.vue';
|
|
import Buy from './components/buy/index.vue';
|
|
|
import Sell from './components/sell/index.vue';
|
|
import Sell from './components/sell/index.vue';
|
|
|
import { LineChartOutlined } from '@ant-design/icons-vue';
|
|
import { LineChartOutlined } from '@ant-design/icons-vue';
|
|
|
-// import { getBuyAndSellMarketData } from '../../setup';
|
|
|
|
|
import { handleModalComponent } from '@/common/setup/asyncComponent';
|
|
import { handleModalComponent } from '@/common/setup/asyncComponent';
|
|
|
-import { PropType, ref } from 'vue';
|
|
|
|
|
|
|
+import { onMounted, PropType, ref } from 'vue';
|
|
|
import { handleSpotBtnList } from '../../setup';
|
|
import { handleSpotBtnList } from '../../setup';
|
|
|
-import { addSubscribeQuotation } from '@/services/socket/quota';
|
|
|
|
|
|
|
+import { v4 } from 'uuid';
|
|
|
|
|
+import { addSubscribeQuotation, removeSubscribeQuotation } from '@/services/socket/quota';
|
|
|
import Bus from '@/utils/eventBus/index';
|
|
import Bus from '@/utils/eventBus/index';
|
|
|
import { getQuoteDayInfoByCode } from '@/services/bus/goods';
|
|
import { getQuoteDayInfoByCode } from '@/services/bus/goods';
|
|
|
|
|
|
|
@@ -116,24 +114,38 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
- console.log(props.selectedRow);
|
|
|
|
|
// 买卖大厅 配置数据
|
|
// 买卖大厅 配置数据
|
|
|
// 表格操作按钮列表
|
|
// 表格操作按钮列表
|
|
|
const { firstBtn, buyMarket, sellMarket } = handleSpotBtnList(props.enumName);
|
|
const { firstBtn, buyMarket, sellMarket } = handleSpotBtnList(props.enumName);
|
|
|
- const quoteData = getQuoteDayInfoByCode(props.selectedRow.goodscode);
|
|
|
|
|
|
|
+ /*** ====== 处理浮动价 =======******/
|
|
|
|
|
+ // 是否为浮动价
|
|
|
|
|
+ function isFloatPrice() {
|
|
|
|
|
+ return props.enumName === EnumRouterName.warehouse_receipt_trade_floating_price || props.enumName === EnumRouterName.warehouse_pre_sale_floating_price;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 获取浮动价商品实时价格
|
|
|
function getGoodsPrice() {
|
|
function getGoodsPrice() {
|
|
|
- // const quoteData = getQuoteDayInfoByCode(props.selectedRow.goodscode);
|
|
|
|
|
- console.log('quoteData', quoteData);
|
|
|
|
|
|
|
+ const quoteData = getQuoteDayInfoByCode(props.selectedRow.goodscode);
|
|
|
return quoteData ? quoteData.ask : '--';
|
|
return quoteData ? quoteData.ask : '--';
|
|
|
}
|
|
}
|
|
|
|
|
+ const uuid = v4();
|
|
|
|
|
+ if (isFloatPrice()) {
|
|
|
|
|
+ // 如果是浮动价需要行情订阅
|
|
|
|
|
+ const arr = [{ exchangeCode: 250, goodsCode: props.selectedRow.goodscode, subState: 0 }];
|
|
|
|
|
+ addSubscribeQuotation(uuid, arr);
|
|
|
|
|
+ }
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
|
+ removeSubscribeQuotation(uuid);
|
|
|
|
|
+ });
|
|
|
const { childRef: buyRef, loadChildComponentData: loadBuyData } = handleChildComponentMethod();
|
|
const { childRef: buyRef, loadChildComponentData: loadBuyData } = handleChildComponentMethod();
|
|
|
const { childRef: sellRef, loadChildComponentData: loadSellData } = handleChildComponentMethod();
|
|
const { childRef: sellRef, loadChildComponentData: loadSellData } = handleChildComponentMethod();
|
|
|
const { componentId, closeComponent, openComponent } = handleModalComponent(loadBuyData, ref({}));
|
|
const { componentId, closeComponent, openComponent } = handleModalComponent(loadBuyData, ref({}));
|
|
|
|
|
+ // 单据挂牌成功 通知买大厅刷新数据
|
|
|
Bus.$on('spotTrade', loadSellData);
|
|
Bus.$on('spotTrade', loadSellData);
|
|
|
return {
|
|
return {
|
|
|
buyRef,
|
|
buyRef,
|
|
|
sellRef,
|
|
sellRef,
|
|
|
cancel,
|
|
cancel,
|
|
|
|
|
+ isFloatPrice,
|
|
|
getGoodsPrice,
|
|
getGoodsPrice,
|
|
|
visible,
|
|
visible,
|
|
|
firstBtn,
|
|
firstBtn,
|