|
@@ -293,13 +293,13 @@ import { validateAction } from '@/common/setup/form';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
import { useBlocksAccount, useBlocksFriends, useBlocksMoney, useBlocksNumber, useBlocksPermaceTemp, useBlocksPrice } from '@/common/setup/warehouse_receipt_trade/listing';
|
|
import { useBlocksAccount, useBlocksFriends, useBlocksMoney, useBlocksNumber, useBlocksPermaceTemp, useBlocksPrice } from '@/common/setup/warehouse_receipt_trade/listing';
|
|
|
import { getCanUseMoney, getInTaAccount, getUserId } from '@/services/bus/account';
|
|
import { getCanUseMoney, getInTaAccount, getUserId } from '@/services/bus/account';
|
|
|
|
|
+import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
|
|
|
import { getMarketRunByTradeMode } from '@/services/bus/market';
|
|
import { getMarketRunByTradeMode } from '@/services/bus/market';
|
|
|
import { WrHoldLB } from '@/services/go/wrtrade/interface';
|
|
import { WrHoldLB } from '@/services/go/wrtrade/interface';
|
|
|
import { hdWROrder } from '@/services/proto/warehousetrade';
|
|
import { hdWROrder } from '@/services/proto/warehousetrade';
|
|
|
import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
|
|
import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
|
|
|
import { addSubscribeQuotation, removeSubscribeQuotation } from '@/services/socket/quota';
|
|
import { addSubscribeQuotation, removeSubscribeQuotation } from '@/services/socket/quota';
|
|
|
import Bus from '@/utils/eventBus/index';
|
|
import Bus from '@/utils/eventBus/index';
|
|
|
-import { getGoodsPrice } from '@/views/market/spot_trade/components/buy-sell-market/setup';
|
|
|
|
|
import { message } from 'ant-design-vue';
|
|
import { message } from 'ant-design-vue';
|
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
import { v4 } from 'uuid';
|
|
import { v4 } from 'uuid';
|
|
@@ -338,23 +338,27 @@ export default defineComponent({
|
|
|
formRef.value.validate();
|
|
formRef.value.validate();
|
|
|
}
|
|
}
|
|
|
const uuid = v4();
|
|
const uuid = v4();
|
|
|
|
|
+ const goodsCode = ref<string>('');
|
|
|
// 切换商品
|
|
// 切换商品
|
|
|
function handleGoodsChange(id: number) {
|
|
function handleGoodsChange(id: number) {
|
|
|
//行情订阅
|
|
//行情订阅
|
|
|
removeSubscribeQuotation(uuid);
|
|
removeSubscribeQuotation(uuid);
|
|
|
- const goodsCode = goodsList.value.find((e) => e.goodsid === id)?.goodscode as string;
|
|
|
|
|
- const arr = [{ exchangeCode: 250, goodsCode: goodsCode, subState: 0 }];
|
|
|
|
|
|
|
+ goodsCode.value = goodsList.value.find((e) => e.goodsid === id)?.goodscode as string;
|
|
|
|
|
+ const arr = [{ exchangeCode: 250, goodsCode: goodsCode.value, subState: 0 }];
|
|
|
addSubscribeQuotation(uuid, arr);
|
|
addSubscribeQuotation(uuid, arr);
|
|
|
formRef.value.validate();
|
|
formRef.value.validate();
|
|
|
}
|
|
}
|
|
|
// 估算价
|
|
// 估算价
|
|
|
function getPrice() {
|
|
function getPrice() {
|
|
|
let result = '--';
|
|
let result = '--';
|
|
|
- const goodsPrice = getGoodsPrice();
|
|
|
|
|
- if (goodsPrice.value && goodsPrice.value !== '--') {
|
|
|
|
|
- // 有实时行情价格
|
|
|
|
|
- result = ((goodsPrice.value as number) + formState.PriceMove).toFixed(2);
|
|
|
|
|
|
|
+ if (goodsCode.value) {
|
|
|
|
|
+ const goodsPrice = getQuoteDayInfoByCodeFindPrice(goodsCode.value);
|
|
|
|
|
+ if (goodsPrice && goodsPrice !== '--') {
|
|
|
|
|
+ // 有实时行情价格
|
|
|
|
|
+ result = ((goodsPrice as number) + formState.PriceMove).toFixed(2);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|