huangbin il y a 4 ans
Parent
commit
29fb8a3702

+ 14 - 3
src/views/market/spot_trade/components/buy-sell-market/components/delisting/index.vue

@@ -118,6 +118,7 @@ import { message } from 'ant-design-vue';
 import { handleForm } from './setup';
 import { validateAction } from '@/common/setup/form';
 import { ListingForm } from './interface';
+import Long from "long";
 import { BuyOrSell } from '@/common/constants/enumCommon';
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_delisting,
@@ -147,7 +148,9 @@ export default defineComponent({
         const loading = ref<boolean>(false);
         function submit() {
             validateAction<ListingForm>(formRef, formState).then((res) => {
-                // 摘卖方向
+
+                // 首先确定  这是仓单贸易的有仓单挂摘牌 HasWr = 1
+                // 其次判断  摘牌 1。摘买 (需要通过自己的仓单进行摘买)  2。摘卖 (不需要通过仓单)
                 const param: HdWRDealOrderReq = {
                     UserID: getUserId(), // uint32 用户ID
                     AccountID: getSelectedAccountId(), // uint64 资金账号
@@ -167,8 +170,16 @@ export default defineComponent({
                     TradeDate: moment().format('YYYYMMDD'), // string 交易日
                     DeliveryMonth: '', // string 交收月
                     HasWr: 1, // uint32 是否有仓单-0:没有仓单 1:有仓单
-                };
-                // console.log(param);
+                }
+
+                // 摘买方向
+                if(props.buyOrSell === BuyOrSell.buy){
+                    param.BuyOrSell = 1
+                    param.LadingBillId = Long.fromString("2081627550296000001")
+                }else{
+                    param.BuyOrSell = 0
+                }
+
                 requestResultLoadingAndInfo(HdWRDealOrder, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {
                     cancel(true);
                 });

+ 1 - 1
src/views/market/spot_trade/components/buy-sell-market/components/sell/index.vue

@@ -20,7 +20,7 @@
   <component :is="componentId"
              v-if="componentId"
              :selectedRow="selectedRow"
-             :buyOrSell="BuyOrSell.buy"
+             :buyOrSell="BuyOrSell.sell"
              :parantSelectedRow="parantSelectedRow"
              @cancel="closeComponent"></component>
 </template>

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

@@ -73,7 +73,8 @@
             <a-col :span="24"
                    class="mt20">
               <a-form-item class="tc">
-                <a-button class="listedBtn">买入</a-button>
+                <a-button class="listedBtn"
+                          @click="submit">买入</a-button>
                 <a-button class="listedBtn ml10">融资买入</a-button>
                 <a-button class="ml10 cancelBtn"
                           @click="cancel">取消</a-button>
@@ -87,13 +88,21 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType } from 'vue';
+    import {defineComponent, PropType, ref} from 'vue';
 import { Des } from '@/common/components/commonDes';
 import { QhjAgreementConfig } from '@/services/go/ermcp/qhj/interface';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import Drawer from '@/common/components/drawer/index.vue';
 import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
+    import {hdWROrder, wRListingCancelOrder} from "@/services/proto/warehousetrade";
+import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
+    import {HdWROrderReq} from "@/services/proto/warehousetrade/interface";
+    import {getInTaAccount, getUserId} from "@/services/bus/account";
+    import {v4 as uuidv4} from "uuid";
+    import moment from "moment";
+    import {getMarketRunByTradeMode} from "@/services/bus/market";
+    import {WrOrderQuote} from "@/services/go/wrtrade/interface";
 
 export default defineComponent({
     emits: ['cancel'],
@@ -101,13 +110,64 @@ export default defineComponent({
     components: { Des, Drawer, PlusOutlined, MinusOutlined },
     props: {
         selectedRow: {
-            type: Object as PropType<QhjAgreementConfig>,
+            type: Object as PropType<WrOrderQuote>,
             default: {},
         },
     },
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
+        const loading = ref<boolean>(false);
+        function submit() {
+            const marketInfo = getMarketRunByTradeMode(17);
+            if (marketInfo) {
+                const param = {
+                    AccountID: getInTaAccount(), // 默认内部资金账号第一个
+                    ClientSerialNo: uuidv4(), // 客户端流水号
+                    // OperateSrc: 2,
+                    ClientType: 4,
+                    // MarketID: marketInfo.marketid,
+                    LadingBillId: 0, // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+                    // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+                    TradeDate: moment(marketInfo.tradedate).format('YYYYMMDD'), // 交易日 string
+                    // SubNum: '0', // 提单子单号
+                    SubNum: 0,
+                    // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+                    WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+                    IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
+                    // MatchUserIDs: 0, // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
+                    OrderQty: 123, // 委托数量(可挂部分数据量) ======
+                    DeliveryGoodsID: props.selectedRow.deliverygoodsid, // 交割商品商品ID  // 有仓单求购
+                    WRPriceType: 1, // 价格方式 1:固定价 2:浮动价
+                    FixedPrice: 321, // 固定价格
+                    PriceFactor: 1, // 价格系数(浮动价时填写)
+                    PriceMove: 0, // 升贴水(浮动价时填写)
+                    TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
+                    // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
+                    ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
+                    FirstRatio: 0, // 首付比例
+                    PerformanceTemplateID: 0, // 履约计划模板ID
+                    UserID: getUserId(),
+                    OperatorID: getUserId(), // 操作员账号ID
+                    BuyOrSell: 0, // 买卖方向 0买1卖
+                    PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
+                    CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
+                    Attachment1: '', // 附件1
+                    Attachment2: '', // 附件2
+                    Remark: '222', // 备注
+                    ApplyID: 0, // 申请ID
+                    WRTradeGoods: [],
+                    CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
+                    WRStandardID: props.selectedRow.wrstandardid,
+                    HasWr: 1,  // 无仓单挂牌  是否有无仓单
+                }
+                debugger
+                requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
+                    cancel()
+                })
+            }
+        }
         return {
+            submit,
             cancel,
             visible,
         };

+ 13 - 2
src/views/order/spot_warran/components/spot_warrant_pending_order/components/cancle/index.vue

@@ -15,7 +15,7 @@ import Drawer from '@/common/components/drawer/index.vue';
 import { QueryWrPositionReq, WrHoldLB, WrPosition } from '@/services/go/wrtrade/interface';
 import { getInTaAccount, getUserId } from '@/services/bus/account';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { hdWROrder } from '@/services/proto/warehousetrade';
+import {hdWROrder, wRListingCancelOrder} from '@/services/proto/warehousetrade';
 import { v4 as uuidv4 } from 'uuid';
 import moment from 'moment';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
@@ -25,7 +25,7 @@ import { getMarketRunByTradeMode } from '@/services/bus/market';
 import { message } from 'ant-design-vue';
 import { getGoodsGroupsByTradeMode } from '@/services/bus/goods';
 import { TradeMode } from '@/common/constants/enumCommon';
-import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
+import {WRGoodsInfo, WRListingCancelOrderReq} from '@/services/proto/warehousetrade/interface';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_spot_details_listed,
@@ -40,6 +40,17 @@ export default defineComponent({
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
         console.log('selectedRow', props.selectedRow);
+        const loading = ref<boolean>(false);
+        function submit() {
+
+            // const param: WRListingCancelOrderReq = {
+            //
+            // }
+            //
+            // requestResultLoadingAndInfo(wRListingCancelOrder, param, loading, ['撤单成功', '撤单失败:']).then(() => {
+            //     cancel();
+            // });
+        }
 
         return {
             visible,

+ 3 - 0
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -185,6 +185,8 @@ export default defineComponent({
                         WeightRatio: 1, // double 商品重量系数
                     };
 
+                    // 仓单贸易挂牌  (仓单贸易 = HasWr = 1)
+
                     const param = {
                         AccountID: getInTaAccount(), // 默认内部资金账号第一个
                         ClientSerialNo: uuidv4(), // 客户端流水号
@@ -225,6 +227,7 @@ export default defineComponent({
                         wrstandardid: props.selectedRow.wrstandardid,
                         HasWr: 1,
                     };
+                    debugger;
                     console.log(param);
                     requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
                         Bus.$emit('spotTrade', true);

+ 0 - 1
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -29,7 +29,6 @@ export function handlePasswordForm(data: WrHoldLB) {
         OrderQty: [{ required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number', min: 1, ma: data.enableqty }],
         PriceMove: [{ required: true, message: '请输入升贴水', trigger: 'blur', type: 'number', }],
         goodsid: [{ required: true, validator: v_group }],
-
     }
     return { rules, formState, formRef }
 }