|
|
@@ -2,12 +2,10 @@ import { getPayCurrencyTypeEnumList } from "@/common/constants/enumsList";
|
|
|
import { getGoodsUnitEnumItemName } from "@/common/constants/enumsName";
|
|
|
import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
|
|
|
import { validateCommon } from "@/common/setup/validate";
|
|
|
-import APP from '@/services';
|
|
|
import { QueryCustomInfo } from "@/services/go/ermcp/customInfo";
|
|
|
import { QueryCustomInfoType } from "@/services/go/ermcp/customInfo/interface";
|
|
|
import { QueryDeliveryGoods, GetDeliveryGoodsDetail } from "@/services/go/ermcp/goodsInfo";
|
|
|
-import { TBGoods } from "@/services/go/ermcp/goodsInfo/interface/deliverygoodsdetail";
|
|
|
-import { Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsDetailEx, ErmcpDeliveryGoodsRsp } from "@/services/go/ermcp/goodsInfo/interface";
|
|
|
+import { ErmcpDeliveryGoodsRsp } from "@/services/go/ermcp/goodsInfo/interface";
|
|
|
import { orderContract, spotContractStatus } from "@/services/proto/spotcontract";
|
|
|
import {
|
|
|
GldErmcpSpotContractOperateReq,
|
|
|
@@ -20,6 +18,7 @@ import Long from 'long';
|
|
|
import moment, { Moment } from "moment";
|
|
|
import { reactive, ref, Ref, UnwrapRef } from "vue";
|
|
|
import { FormState } from './interface';
|
|
|
+import { Ermcp3DeliveryGoodsDetail, XHBRAND, XHWrstandard, TBGoods } from '@/services/go/ermcp/goodsInfo/interface/deliverygoodsdetail'
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -249,12 +248,14 @@ export function handleContract(formState: UnwrapRef<FormState>) {
|
|
|
export function handleDeliveryGoods(formState: UnwrapRef<FormState>) {
|
|
|
// 现货品种
|
|
|
const deliveryGoodsList = ref<ErmcpDeliveryGoodsRsp[]>([])
|
|
|
+ // 现货商品详情
|
|
|
+ let goodsDetailList: Ermcp3DeliveryGoodsDetail[] = [];
|
|
|
// 品牌
|
|
|
- const gblist = ref<Ermcp3Brand[]>([])
|
|
|
+ const bdlst = ref<XHBRAND[]>([])
|
|
|
// 品类列表
|
|
|
- const gmlist = ref<Ermcp3Wrstandard[]>([])
|
|
|
+ const wdlst = ref<XHWrstandard[]>([])
|
|
|
// 合约列表
|
|
|
- const goodsList = ref<TBGoods[]>([]);
|
|
|
+ const gdlist = ref<TBGoods[]>([]);
|
|
|
|
|
|
// 查询现货商品
|
|
|
function getDeliveryGoods() {
|
|
|
@@ -266,72 +267,55 @@ export function handleDeliveryGoods(formState: UnwrapRef<FormState>) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ GetDeliveryGoodsDetail().then((res) => {
|
|
|
+ goodsDetailList=res
|
|
|
+ })
|
|
|
// 查询商品列表
|
|
|
- function getGoodsList(deliverygoodsid: number, wrstandardid: number) {
|
|
|
- goodsList.value.length = 0;
|
|
|
- GetDeliveryGoodsDetail(deliverygoodsid).then((res) => {
|
|
|
- res.forEach((deliverygoods) => {
|
|
|
- // 查询现货商品
|
|
|
- const wrstandard = deliverygoods.wdlst.find((e) => e.wrstandardid === wrstandardid);
|
|
|
- if (wrstandard) {
|
|
|
- // 套保品种列表
|
|
|
- wrstandard.mglst.forEach((middlegoods) => {
|
|
|
- // 期货品种列表
|
|
|
- middlegoods.GPLST.forEach((item) => {
|
|
|
- goodsList.value.push(...item.GDLST);
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ function getGoodsList(value:number) {
|
|
|
+ gdlist.value.length = 0;
|
|
|
+ const obj=goodsDetailList.find(itme=>itme.deliverygoodsid===value)
|
|
|
+ if(obj){
|
|
|
+ bdlst.value=obj.bdlst
|
|
|
+ wdlst.value=obj.wdlst
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 切换现货商品
|
|
|
function deliveryGoodsChange(value: number | undefined) {
|
|
|
if (value !== undefined) {
|
|
|
- getDeliveryGoodsDetail(value)
|
|
|
+ getGoodsList(value)
|
|
|
} else {
|
|
|
- gblist.value.length = 0
|
|
|
- gmlist.value.length = 0
|
|
|
+ bdlst.value.length = 0
|
|
|
+ wdlst.value.length = 0
|
|
|
}
|
|
|
formState.WrStandardID = undefined;
|
|
|
formState.SpotGoodsBrandID = undefined;
|
|
|
formState.ConvertFactor = undefined;
|
|
|
- }
|
|
|
-
|
|
|
- // 查询现货商品详情
|
|
|
- function getDeliveryGoodsDetail(deliverygoodsid: number) {
|
|
|
- const temp = APP.get('DeliveryGoodsList').find((e: ErmcpDeliveryGoodsDetailEx) => e.data.deliverygoodsid === deliverygoodsid)
|
|
|
- if (temp) {
|
|
|
- gblist.value = temp.gblist
|
|
|
- gmlist.value = temp.gmlist
|
|
|
- }
|
|
|
+ formState.GoodsID = undefined;
|
|
|
}
|
|
|
|
|
|
const numberUnit = ref<string>('')
|
|
|
|
|
|
// 品类变更
|
|
|
function WrStandardChange(value: number) {
|
|
|
- const obj = gmlist.value.find((e) => e.wrstandardid === value);
|
|
|
- if (obj) {
|
|
|
- //标仓系数
|
|
|
- formState.ConvertFactor = obj.convertfactor;
|
|
|
- // 单位
|
|
|
- numberUnit.value = getGoodsUnitEnumItemName(obj.unitid);
|
|
|
- getGoodsList(obj.deliverygoodsid, obj.wrstandardid);
|
|
|
+ const obj=wdlst.value.find(item=>item.wrstandardid===value)
|
|
|
+ if(obj){
|
|
|
+ gdlist.value=obj.mglst[0].GPLST[0].GDLST
|
|
|
}
|
|
|
+ formState.GoodsID = undefined;
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
deliveryGoodsList,
|
|
|
- gblist,
|
|
|
- gmlist,
|
|
|
- goodsList,
|
|
|
+ bdlst,
|
|
|
+ wdlst,
|
|
|
+ gdlist,
|
|
|
numberUnit,
|
|
|
WrStandardChange,
|
|
|
getDeliveryGoods,
|
|
|
- getDeliveryGoodsDetail,
|
|
|
- deliveryGoodsChange
|
|
|
+ deliveryGoodsChange,
|
|
|
+ GetDeliveryGoodsDetail
|
|
|
}
|
|
|
}
|
|
|
|