huangbin 4 年 前
コミット
2cf9e155a1

+ 4 - 3
src/services/proto/warehousetrade/interface.ts

@@ -77,11 +77,12 @@ export interface HdWRDealOrderReq {
 }
 
 export interface WrBargainApplyReq {
-    WRTradeOrderID: number; // 关联委托单ID
+    // WRTradeOrderID: number; // 关联委托单ID
+    RelatedWRTradeOrderID: number; // 关联委托单ID
     ApplyQty: number; // 摘牌数量
-    UserID: string; //摘牌人用户ID
+    UserID: number; //摘牌人用户ID
     AccountID: string; //摘牌资金账号
-    BuyOrSell: string; //摘牌方向
+    BuyOrSell: number; //摘牌方向
     ApplyPrice: string; //申请价格
     ApplyRemark: string; //申请备注
 }

+ 24 - 11
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/components/delisting/index.vue

@@ -211,10 +211,16 @@ export default defineComponent({
         function getSelectedAccount() {
             return accountList.find((e) => e.accountid === formState.accountid)!;
         }
+        function getPrice() {
+            return isBargin() ? formState.price : props.selectedRow.fixedprice;
+        }
+        function getNum() {
+            return isCanpart() ? formState.num : props.selectedRow.orderqty;
+        }
         // 摘牌金额
         function getMoney() {
-            const price = isBargin() ? formState.price : props.selectedRow.fixedprice;
-            const num = isCanpart() ? formState.num : props.selectedRow.orderqty;
+            const price = getPrice();
+            const num = getNum();
             if (price) {
                 return (price * num).toFixed(2);
             } else {
@@ -223,8 +229,8 @@ export default defineComponent({
         }
         // 履约保证金
         function getMargin() {
-            const price = isBargin() ? formState.price : props.selectedRow.fixedprice;
-            const num = isCanpart() ? formState.num : props.selectedRow.orderqty;
+            const price = getPrice();
+            const num = getNum();
             let result = 0;
             const { marginvalue } = props.selectedRow;
             if (price && num && marginvalue) {
@@ -272,16 +278,23 @@ export default defineComponent({
 
         function submit() {
             validateAction<ListingForm>(formRef, formState).then((res) => {
+                const price = getPrice();
+                const num = getNum();
                 if (isBargin()) {
                     // 议价摘牌
-                    const param: WrBargainApplyReq = {
-                        WRTradeOrderID: Long.fromString(props.selectedRow.wrtradeorderid),
-                        ApplyQty: 10,
-                        UserID: String(getUserId()),
+                    const param = {
+                        RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid,
+                        ApplyQty: num,
+                        UserID: getUserId(),
                         AccountID: getSelectedAccountId().toString(),
-                        BuyOrSell: props.buyOrSell.toString(),
-                        ApplyPrice: formState.price.toString(),
+                        BuyOrSell: isBuy() ? BuyOrSell.sell : BuyOrSell.buy,
+                        ApplyPrice: price.toString(),
                         ApplyRemark: '',
+                        OrderSrc: 0, // uint32 委托来源
+                        ClientSerialNo: uuidv4(), // string 客户端流水号
+                        ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
+                        ClientType: 4, // uint32 终端类型
+                        OperatorID: getUserId(), // uint64 操作员账号ID
                     };
                     requestResultLoadingAndInfo(wrBargainApply, param, loading, ['议价摘牌成功', '议价摘牌失败:']).then(() => {
                         cancel(true);
@@ -294,7 +307,7 @@ export default defineComponent({
                         AccountID: getSelectedAccountId(), // uint64 资金账号
                         RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
                         WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
-                        OrderQty: res.num as number, // uint64 委托数量
+                        OrderQty: num, // uint64 委托数量
                         OrderSrc: 0, // uint32 委托来源
                         ClientSerialNo: uuidv4(), // string 客户端流水号
                         ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间

+ 26 - 12
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/index.vue

@@ -211,10 +211,16 @@ export default defineComponent({
         function getSelectedAccount() {
             return accountList.find((e) => e.accountid === formState.accountid)!;
         }
+        function getPrice() {
+            return isBargin() ? formState.price : props.selectedRow.fixedprice;
+        }
+        function getNum() {
+            return isCanpart() ? formState.num : props.selectedRow.orderqty;
+        }
         // 摘牌金额
         function getMoney() {
-            const price = isBargin() ? formState.price : props.selectedRow.fixedprice;
-            const num = isCanpart() ? formState.num : props.selectedRow.orderqty;
+            const price = getPrice();
+            const num = getNum();
             if (price) {
                 return (price * num).toFixed(2);
             } else {
@@ -223,8 +229,8 @@ export default defineComponent({
         }
         // 履约保证金
         function getMargin() {
-            const price = isBargin() ? formState.price : props.selectedRow.fixedprice;
-            const num = isCanpart() ? formState.num : props.selectedRow.orderqty;
+            const price = getPrice();
+            const num = getNum();
             let result = 0;
             const { marginvalue } = props.selectedRow;
             if (price && num && marginvalue) {
@@ -272,16 +278,24 @@ export default defineComponent({
 
         function submit() {
             validateAction<ListingForm>(formRef, formState).then((res) => {
+                debugger;
+                const price = getPrice();
+                const num = getNum();
                 if (isBargin()) {
                     // 议价摘牌
-                    const param: WrBargainApplyReq = {
-                        WRTradeOrderID: Long.fromString(props.selectedRow.wrtradeorderid),
-                        ApplyQty: 10,
-                        UserID: String(getUserId()),
+                    const param = {
+                        RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid,
+                        ApplyQty: num,
+                        UserID: getUserId(),
                         AccountID: getSelectedAccountId().toString(),
-                        BuyOrSell: props.buyOrSell.toString(),
-                        ApplyPrice: formState.price.toString(),
+                        BuyOrSell: isBuy() ? BuyOrSell.sell : BuyOrSell.buy,
+                        ApplyPrice: price.toString(),
                         ApplyRemark: '',
+                        OrderSrc: 0, // uint32 委托来源
+                        ClientSerialNo: uuidv4(), // string 客户端流水号
+                        ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
+                        ClientType: 4, // uint32 终端类型
+                        OperatorID: getUserId(), // uint64 操作员账号ID
                     };
                     requestResultLoadingAndInfo(wrBargainApply, param, loading, ['议价摘牌成功', '议价摘牌失败:']).then(() => {
                         cancel(true);
@@ -294,13 +308,13 @@ export default defineComponent({
                         AccountID: getSelectedAccountId(), // uint64 资金账号
                         RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
                         WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
-                        OrderQty: res.num as number, // uint64 委托数量
+                        OrderQty: num, // uint64 委托数量
                         OrderSrc: 0, // uint32 委托来源
                         ClientSerialNo: uuidv4(), // string 客户端流水号
                         ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
                         ClientType: 4, // uint32 终端类型
                         OperatorID: getUserId(), // uint64 操作员账号ID
-                        BuyOrSell: 0, // uint32 买卖方向
+                        BuyOrSell: isBuy() ? BuyOrSell.sell : BuyOrSell.buy, // uint32 买卖方向
                         ApplyID: 0, // uint64 申请ID
                         LadingBillId: 0, // uint64 提单id(wrholdlb的LadingBillId字段),卖的时候填写
                         SubNum: 0, // uint64 提单子单号(wrholdlb的SubNum字段),卖的时候填写