Przeglądaj źródła

commit 现货贸易挂牌

yu jie 4 lat temu
rodzic
commit
7cf301347f

+ 26 - 0
src/common/constants/enumsName.ts

@@ -877,6 +877,32 @@ export function getScfContractStatusName(type: number) {
     return result
 }
 
+//scfcontracttype: number;//合同类型 - 1:仓单回购 2:仓单质押 3:合作套保 4:资金贷款 5:融资单 6:融资回购
+export function getScfContractTypeName(type: number) {
+    let result = "--"
+    switch (type) {
+        case 1:
+            result = '仓单回购'
+            break
+        case 2:
+            result = '仓单质押'
+            break
+        case 3:
+            result = '合作套保'
+            break
+        case 4:
+            result = '资金贷款'
+            break
+        case 5:
+            result = '融资单'
+            break
+        case 6:
+            result = '融资回购'
+            break
+    }
+    return result
+}
+
 
 /**
  * 资金操作类型

+ 16 - 3
src/views/market/spot_trade/components/post_buying/index.vue

@@ -149,7 +149,7 @@ import Drawer from '@/common/components/drawer/index.vue';
 import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
 import { hdWROrder } from '@/services/proto/warehousetrade';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
+import {DGFactoryItems, WRGoodsInfo} from '@/services/proto/warehousetrade/interface';
 import { getAccountTypeList, getUserId } from '@/services/bus/account';
 import { v4 as uuidv4 } from 'uuid';
 import moment, { Moment } from 'moment';
@@ -157,7 +157,7 @@ import { getMarketRunByTradeMode } from '@/services/bus/market';
 import { WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { handleForm, handleNumAndPrice } from './setup';
 import { validateAction } from '@/common/setup/form';
-import { FormParam } from './interface';
+import {FormParam, TempWrOrderQuoteDetail} from './interface';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { handleIs } from '../buy-sell-market/setup';
 import { BuyOrSell } from '@/common/constants/enumCommon';
@@ -169,7 +169,7 @@ export default defineComponent({
     components: { Des, Drawer, PlusOutlined, MinusOutlined },
     props: {
         selectedRow: {
-            type: Object as PropType<WrOrderQuote>,
+            type: Object as PropType<TempWrOrderQuoteDetail>,
             default: {},
         },
         enumName: {
@@ -200,6 +200,10 @@ export default defineComponent({
             const marketInfo = getMarketRunByTradeMode(17);
             if (marketInfo) {
                 validateAction<FormParam>(formRef, formState).then((res) => {
+
+                    // 现在增加一种挂牌求购的情况
+                    // 这种求购模式会生成一种仓单贸易商品
+
                     const wrGoodsInfo: WRGoodsInfo = {
                         GoodsID: props.selectedRow.goodsid, // uint32 配置商品ID
                         GoodsCode: props.selectedRow.goodscode, // string 配置商品代码
@@ -248,7 +252,16 @@ export default defineComponent({
                         WRStandardID: props.selectedRow.wrstandardid,
                         HasWr: isWR(), // 无仓单挂牌  是否有无仓单
                         DeliveryMonth: isWR() ? '' : moment(res.DeliveryMonth).format('YYYY-MM'),
+                        FactoryItems: props.selectedRow.wrResult.flatMap((it) => {
+                                return {
+                                    DGFactoryItemTypeID: it.dgfactoryitemtypeid, // uint64 要素项类型ID
+                                    DGFactoryItemID: it.dgfactoryitemid, // uint64 预约要素项类型值
+                                    ItemTypeMode: 1, // uint32 要素项类型模式
+                                }
+                            }
+                        ) // DGFactoryItems 要素类型明细集合(没有仓单要素ID填写)
                     };
+                    debugger
                     requestResultLoadingAndInfo(hdWROrder, param, loading, ['求购成功', '求购失败:']).then(() => {
                         cancel(true);
                     });

+ 6 - 0
src/views/market/spot_trade/components/post_buying/interface.ts

@@ -1,4 +1,5 @@
 import { Moment } from "moment";
+import {WrOrderQuote, WrOrderQuoteDetail} from "@/services/go/wrtrade/interface";
 
 export interface FormParam {
     accountid: undefined | number,
@@ -7,3 +8,8 @@ export interface FormParam {
     PriceMove: number,
     DeliveryMonth: Moment,
 }
+
+
+export interface TempWrOrderQuoteDetail extends WrOrderQuote {
+    wrResult: { dgfactoryitemtypeid: number; dgfactoryitemid: number }[]
+}

+ 6 - 1
src/views/order/financing_manager/components/financing_manager_contract/index.vue

@@ -32,6 +32,10 @@
       <template #createtime="{ record }">
         <a>{{ formatTime(record.createtime) }}</a>
       </template>
+        <template #scfcontracttype="{ record }">
+            <a>{{ getScfContractTypeName(record.scfcontracttype) }}</a>
+        </template>
+
     </a-table>
     <component :is="componentId"
                v-if="componentId"
@@ -50,7 +54,7 @@ import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { formatTime } from '@/common/methods';
 import { expandIcon } from '@/common/setup/table/clolumn';
-import { getContractName, getFinanceTypeName } from '@/common/constants/enumsName';
+import {getContractName, getFinanceTypeName, getScfContractTypeName} from '@/common/constants/enumsName';
 import { BtnList as BtnListType } from '@/common/components/btnList/interface';
 
 export default defineComponent({
@@ -94,6 +98,7 @@ export default defineComponent({
             getContractName,
             getFinanceTypeName,
             handleBtnList,
+            getScfContractTypeName,
         };
     },
 });