فهرست منبع

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

huangbin 4 سال پیش
والد
کامیت
cefd107635

+ 23 - 0
public/proto/mtp.proto

@@ -2023,4 +2023,27 @@ message PerformancePlanTemplateRsp {
 	optional int32 RetCode = 2; // int32 返回码
 	optional string RetDesc = 3; // string 描述信息
 	optional uint64 autoid = 4; // uint64 履约计划模板主键
+}
+// 按单平仓请求 0 3 105
+message HolderCloseReq {
+        optional MessageHead Header = 1; // MessageHead
+        optional uint64 TradeID = 2; // uint64 持仓单号
+        optional string ClientSerialNo = 3; // string 客户端流水号
+        optional string ClientOrderTime = 4; // string 客户端委托时间
+        optional uint32 ClientType = 5; // uint32 终端类型
+        optional uint64 LoginID = 6; // uint64 登陆账号
+        optional uint64 AccountID = 7; // uint64 交易账号
+        optional uint32 GoodsID = 8; // uint32 商品ID
+        optional uint32 BuyOrSell = 9; // uint32 买卖方向
+        optional uint32 MarketID = 10; // uint32 市场ID
+        optional uint32 OrderSrc = 11; // uint32 单据来源
+        optional uint64 OperatorID = 12; // uint64 操作员账号ID
+}
+// 按单平仓应答 0 3 106
+message HolderCloseRsp {
+        optional MessageHead Header = 1; // MessageHead 消息头
+        optional int32 RetCode = 2; // int32 返回码
+        optional string RetDesc = 3; // string 描述信息
+        optional uint64 OrderID = 4; // uint64 一级生成的订单号
+        optional string OrderTime = 5; // string 接收委托交易的时间
 }

+ 1 - 1
src/common/components/echart/echart-timeline/index.vue

@@ -3,7 +3,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref, watch, PropType, onMounted } from 'vue';
+import { defineComponent, ref, watch, PropType, onMounted, computed } from 'vue';
 import { QueryTSDataRsp, QueryQuoteDayRsp } from '@/services/go/quote/interface';
 import { QueryTSData } from '@/services/go/quote';
 import { debounce, getRangeTime } from '@/utils/time';

+ 4 - 0
src/services/funcode/index.ts

@@ -229,4 +229,8 @@ export const funCode: Code = {
     PaymentArrearsReq: 1507337,//               支付欠款请求(0, 23, 9)
     PaymentArrearsRsp: 1507338,//               支付欠款应答(0, 23, 10)
 
+    /// 按单平仓请求(196713)
+    HolderCloseReq: 196713,
+    /// 按单平仓应答(196714)
+    HolderCloseRsp: 196714,
 };

+ 9 - 2
src/services/proto/warehousetrade/index.ts

@@ -2,7 +2,7 @@ import {
     DeliveryOrderReq,
     HdWRDealOrderReq,
     HdWROrderReq, PaymentArrearsReq, TradeHoldTransferApplyAuditReqType, TradeHoldTransferApplyReq, WarehouseRepurchaseReq, WrBargainApplyReq, WRListingCancelOrderReq, WROutApplyCancelReq,
-    WROutApplyReq, WROutCancelReq, WROutConfirmReq, WRTradeFinanceBuyCancelReq
+    WROutApplyReq, WROutCancelReq, WROutConfirmReq, WRTradeFinanceBuyCancelReq, HolderCloseReq
 } from "@/services/proto/warehousetrade/interface";
 import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
 import { HeadEnum } from "@/services/socket/protobuf/protoHeader";
@@ -134,7 +134,14 @@ export const tradeHoldTransferApplyAuditReq = (param: TradeHoldTransferApplyAudi
     return protoMiddleware<TradeHoldTransferApplyAuditReqType>(param, 'TradeHoldTransferApplyAuditReq', 'TradeHoldTransferApplyAuditRsp', HeadEnum.tradeMode17)
 }
 
-
+/**
+ * 按单平仓
+ * @param param
+ * @constructor
+ */
+export const holderClose = (param: HolderCloseReq): Promise<any> => {
+    return protoMiddleware(param, 'HolderCloseReq', 'HolderCloseRsp', HeadEnum.tradeMode17)
+}
 
 // /**
 //  * 议价申请拒绝请求

+ 17 - 0
src/services/proto/warehousetrade/interface.ts

@@ -1,3 +1,6 @@
+/** 
+ * 对应 public/proto/mtp.proto 类型
+*/
 
 // 持仓单挂牌请求 0 22 15
 export interface HdWROrderReq {
@@ -326,6 +329,20 @@ export interface TradeHoldTransferApplyAuditReqType {
     AuditRemark: string; // 审核备注
 }
 
+export interface HolderCloseReq {
+    TradeID: number; // uint64 持仓单号
+    ClientSerialNo: string; // string 客户端流水号
+    ClientOrderTime: string; // string 客户端委托时间
+    ClientType: number; // uint32 终端类型
+    LoginID: number; // uint64 登陆账号
+    AccountID: number; // uint64 交易账号
+    GoodsID: number; // uint32 商品ID
+    BuyOrSell: number; // uint32 买卖方向
+    MarketID: number; // uint32 市场ID
+    OrderSrc: number; // uint32 单据来源
+    OperatorID: number; // uint64 操作员账号ID
+}
+
 // // 议价申请审核请求 0 29 59
 // export interface WrBargainNoAgreeReq {
 //     WrBargainID: number // uint64 申请ID

+ 72 - 93
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_order_closed/index.vue

@@ -1,86 +1,63 @@
 <template>
-  <!-- 按单平仓-->
-  <Drawer :title="'按单平仓'"
-          :placement="'right'"
-          class="bottom486"
-          :visible="visible"
-          @cancel="cancel">
-    <div class="listed c_c_s_s">
-      <a-form class="inlineForm dialogForm"
-              ref="formRef"
-              :model="formState"
-              :rules="rules">
-        <div class="formBar">
-          <div class="formtop">
-            <div class="firstTitle">
-              <span>合约:{{selectedRow.goodscode}}/{{selectedRow.goodsname}}</span>
-            </div>
-            <div class="secondLine">
-              <div class="left">持仓单号/方向</div>
-              <div class="middle">数量/价格/金额</div>
-              <div class="right">到期日/盈亏</div>
-            </div>
-            <a-checkbox-group class="commonCheckboxGroup"
-                              v-model:value="checked"
-                              @change="checkGroupChange">
-              <div class="lineBar"
-                   v-for="item in tableList"
-                   :key="item.tradeid">
-                <div class="line1">
-                  <div class>
-                    <a-checkbox @change="checkboxChange(item)"
-                                :value="item.tradeid"></a-checkbox>
-                  </div>
-                  <div class="name">{{item.tradeid}}</div>
-                  <div class="date">{{formatTime(item.tradetime, 'd')}}</div>
+    <!-- 按单平仓-->
+    <Drawer :title="'按单平仓'" :placement="'right'" class="bottom486" :visible="visible" @cancel="cancel">
+        <div class="listed c_c_s_s">
+            <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
+                <div class="formBar">
+                    <div class="formtop">
+                        <div class="firstTitle">
+                            <span>合约:{{ selectedRow.goodscode }}/{{ selectedRow.goodsname }}</span>
+                        </div>
+                        <div class="secondLine">
+                            <div class="left">持仓单号/方向</div>
+                            <div class="middle">数量/价格/金额</div>
+                            <div class="right">到期日/盈亏</div>
+                        </div>
+                        <a-checkbox-group class="commonCheckboxGroup" v-model:value="checked" @change="checkGroupChange">
+                            <div class="lineBar" v-for="item in tableList" :key="item.tradeid">
+                                <div class="line1">
+                                    <div class>
+                                        <a-checkbox @change="checkboxChange(item)" :value="item.tradeid"></a-checkbox>
+                                    </div>
+                                    <div class="name">{{ item.tradeid }}</div>
+                                    <div class="date">{{ formatTime(item.tradetime, 'd') }}</div>
+                                </div>
+                                <div class="line2">
+                                    <div class="left">{{ item.buyorsell === BuyOrSell.buy ? '买入' : '卖出' }}</div>
+                                    <div class="middle">
+                                        <div>{{ item.holderqty }}</div>
+                                        <div>{{ item.holderprice }}</div>
+                                        <div>{{ item.holderamount }}</div>
+                                    </div>
+                                    <div class="right red">+100</div>
+                                </div>
+                            </div>
+                        </a-checkbox-group>
+                    </div>
                 </div>
-                <div class="line2">
-                  <div class="left">{{item.buyorsell === BuyOrSell.buy ? '买入' : '卖出'}}</div>
-                  <div class="middle">
-                    <div>{{item.holderqty}}</div>
-                    <div>{{item.holderprice}}</div>
-                    <div>{{item.holderamount}}</div>
-                  </div>
-                  <div class="right red">+100</div>
+                <div class="fixedBtns">
+                    <a-row :gutter="24">
+                        <a-col :span="24" class="mt12">
+                            <a-form-item label="估算价" name="price" class="inputIconBox mb10 not-copy">
+                                <a-input-number class="commonInput not-copy" v-model:value="formState.price" style="width: 200px" :min="0" />
+                                <MinusOutlined @click="decreasePrice" />
+                                <PlusOutlined @click="increasePirce" />
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="估算金额" class="mb10 not-copy">
+                                <span class="white">50400.20</span>
+                            </a-form-item>
+                        </a-col>
+                    </a-row>
+                    <a-form-item class="btnCenter mt10">
+                        <a-button class="listedBtn" :loading="loading" :disabled="loading" @click="submit">提交</a-button>
+                        <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
+                    </a-form-item>
                 </div>
-              </div>
-            </a-checkbox-group>
-          </div>
+            </a-form>
         </div>
-        <div class="fixedBtns">
-          <a-row :gutter="24">
-            <a-col :span="24"
-                   class="mt12">
-              <a-form-item label="估算价"
-                           name="price"
-                           class="inputIconBox mb10 not-copy">
-                <a-input-number class="commonInput not-copy"
-                                v-model:value="formState.price"
-                                style="width: 200px"
-                                :min="0" />
-                <MinusOutlined @click="decreasePrice" />
-                <PlusOutlined @click="increasePirce" />
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="估算金额"
-                           class="mb10 not-copy ">
-                <span class="white">50400.20</span>
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-form-item class="btnCenter mt10">
-            <a-button class="listedBtn"
-                      :loading="loading"
-                      :disabled="loading"
-                      @click="submit">提交</a-button>
-            <a-button class="ml10 cancelBtn"
-                      @click="cancel">取消</a-button>
-          </a-form-item>
-        </div>
-      </a-form>
-    </div>
-  </Drawer>
+    </Drawer>
 </template>
 
 <script lang="ts">
@@ -97,8 +74,8 @@ import { geLoginID_number } from '@/services/bus/login';
 import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
 import { queryTradeHolderDetail } from '@/services/go/order';
 import { QueryTradeHolderDetailReq } from '@/services/go/order/interface';
-import { tradeHoldTransferApply } from '@/services/proto/warehousetrade';
-import { TradeHoldTransferApplyReq } from '@/services/proto/warehousetrade/interface';
+import { holderClose } from '@/services/proto/warehousetrade';
+import { HolderCloseReq } from '@/services/proto/warehousetrade/interface';
 import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
 import { message } from 'ant-design-vue';
 import Long from 'long';
@@ -134,6 +111,7 @@ export default defineComponent({
             userid: getUserId(),
             goodsid: props.selectedRow.goodsid,
         };
+
         queryTable(queryTradeHolderDetail, param).then((res) => {
             tableList.value = res.map((e, i) => {
                 if (i) {
@@ -156,15 +134,20 @@ export default defineComponent({
                 return;
             }
             validateAction<FormState>(formRef, formState).then((res) => {
-                const param: TradeHoldTransferApplyReq = {
+                const param: HolderCloseReq = {
                     TradeID: Long.fromString(selected.value!.tradeid),
-                    BuyorSell: selected.value!.buyorsell,
-                    TransferPrice: res.price,
-                    ApplySrc: 2,
-                    ApplicantID: geLoginID_number()!,
-                    Remark: '',
+                    ClientSerialNo: 'string', // string 客户端流水号
+                    ClientOrderTime: 'string', // string 客户端委托时间
+                    ClientType: 0, // uint32 终端类型
+                    LoginID: 0, // uint64 登陆账号
+                    AccountID: 0, // uint64 交易账号
+                    GoodsID: 0, // uint32 商品ID
+                    BuyOrSell: 0, // uint32 买卖方向
+                    MarketID: 0, // uint32 市场ID
+                    OrderSrc: 0, // uint32 单据来源
+                    OperatorID: 0, // uint64 操作员账号ID
                 };
-                requestResultLoadingAndInfo(tradeHoldTransferApply, param, loading, ['协议平仓成功', '协议平仓失败:']).then(() => {
+                requestResultLoadingAndInfo(holderClose, param, loading, ['协议平仓成功', '协议平仓失败:']).then(() => {
                     cancel(true);
                 });
             });
@@ -373,8 +356,4 @@ export default defineComponent({
         }
     }
 }
-</style>;
-
-function queryTradeHolderDetail(queryTradeHolderDetail: any, param: { applytype: number; }) {
-  throw new Error('Function not implemented.');
-}
+</style>;