|
|
@@ -1,9 +1,9 @@
|
|
|
import { BuyOrSell } from "@/common/constants/enumCommon";
|
|
|
import { EnumRouterName } from "@/common/constants/enumRouterName";
|
|
|
-import { queryTableList } from '@/common/export/commonTable';
|
|
|
+import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
|
|
|
import { queryHoldLB } from '@/services/go/wrtrade';
|
|
|
import { WrHoldLB, WrOrderQuoteDetail } from "@/services/go/wrtrade/interface";
|
|
|
-import { reactive, ref, UnwrapRef } from "vue";
|
|
|
+import { reactive, Ref, ref, UnwrapRef } from "vue";
|
|
|
import { ListingForm, Wrhold } from "./interface";
|
|
|
|
|
|
export function handleForm(data: WrOrderQuoteDetail) {
|
|
|
@@ -29,8 +29,8 @@ export function handleIs(enumName: EnumRouterName, buyOrSell: BuyOrSell) {
|
|
|
* @returns true => 仓单预售; false => 仓单贸易
|
|
|
*/
|
|
|
function isSale(): boolean {
|
|
|
- return enumName === EnumRouterName.warehouse_receipt_trade_price ||
|
|
|
- enumName === EnumRouterName.warehouse_receipt_trade_floating_price
|
|
|
+ return enumName === EnumRouterName.warehouse_pre_sale_price ||
|
|
|
+ enumName === EnumRouterName.warehouse_pre_sale_floating_price
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
@@ -43,14 +43,13 @@ export function handleIs(enumName: EnumRouterName, buyOrSell: BuyOrSell) {
|
|
|
}
|
|
|
|
|
|
// 处理现货仓单
|
|
|
-export function handleSpotWarrant(enumName: EnumRouterName, buyOrSell: BuyOrSell, selectedRow: WrOrderQuoteDetail) {
|
|
|
+export function handleSpotWarrant(enumName: EnumRouterName, buyOrSell: BuyOrSell, selectedRow: WrOrderQuoteDetail, loading: Ref<boolean>) {
|
|
|
const { isSale, isBuy } = handleIs(enumName, buyOrSell)
|
|
|
const wrHoldList = ref<Wrhold[]>([])
|
|
|
if (isBuy()) {
|
|
|
- if (isSale()) {
|
|
|
- const { queryTable } = queryTableList<WrHoldLB>();
|
|
|
- queryTable(queryHoldLB).then(res => {
|
|
|
- wrHoldList.value = res.filter(e => e.wrfactortypeid === selectedRow.wrtradeorderid).map(e => {
|
|
|
+ if (!isSale()) {
|
|
|
+ queryResultLoadingAndInfo(queryHoldLB, loading).then(res => {
|
|
|
+ wrHoldList.value = res.filter((e: WrHoldLB) => e.wrfactortypeid === selectedRow.wrtradeorderid).map((e: WrHoldLB) => {
|
|
|
const { wrholdeno, enableqty, ladingbillid } = e
|
|
|
return { id: ladingbillid, name: `${wrholdeno}(${enableqty})` }
|
|
|
})
|