Browse Source

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

chen.zujie 4 years ago
parent
commit
094262d288

+ 10 - 3
src/common/setup/table/interface.ts

@@ -1,15 +1,17 @@
 import { EnumRouterName } from "@/common/constants/enumRouterName";
 import { EnumRouterName } from "@/common/constants/enumRouterName";
 import { ColumnType, TableKey } from "@/common/methods/table/interface";
 import { ColumnType, TableKey } from "@/common/methods/table/interface";
 import { OperationTabMenu } from "@/services/go/commonService/interface";
 import { OperationTabMenu } from "@/services/go/commonService/interface";
-import { Ref } from 'vue';
+import { Ref, UnwrapRef } from 'vue';
 
 
 /**
 /**
- * 表格行情列表
+ * 表格详情
  */
  */
-export interface TableQuote {
+interface QuoteDetail {
+    goodsid: number; // 商品ID
     goodscode: string; // 商品代码
     goodscode: string; // 商品代码
     goodsname: string; // 商品名称
     goodsname: string; // 商品名称
     decimalplace: number;
     decimalplace: number;
+    marketid: number; // 市场ID
     last?: Ref; // 最新价
     last?: Ref; // 最新价
     bid?: Ref; // 买价
     bid?: Ref; // 买价
     ask?: Ref; // 卖价
     ask?: Ref; // 卖价
@@ -26,6 +28,11 @@ export interface TableQuote {
     lowest?: Ref; // 最低
     lowest?: Ref; // 最低
 }
 }
 
 
+/**
+ * 表格行情
+ */
+export type TableQuote = UnwrapRef<QuoteDetail>;
+
 export interface TableEventCB {
 export interface TableEventCB {
     clickCB?: Function; // 单击事件回调函数
     clickCB?: Function; // 单击事件回调函数
     contextmenuCB?: Function; // 右键事件回调函数
     contextmenuCB?: Function; // 右键事件回调函数

+ 5 - 3
src/services/proto/futures/index.ts

@@ -1,5 +1,3 @@
-import { getUserId } from "@/services/bus/user";
-import { geLoginID_number } from "@/services/bus/login";
 import { ChannelOrderReq, ChannelOrderRsp } from "./interface";
 import { ChannelOrderReq, ChannelOrderRsp } from "./interface";
 import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
 import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
 
 
@@ -8,5 +6,9 @@ import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
  * @param param
  * @param param
  */
  */
 export const channelOrderReq = (param: ChannelOrderReq): Promise<ChannelOrderRsp> => {
 export const channelOrderReq = (param: ChannelOrderReq): Promise<ChannelOrderRsp> => {
-    return protoMiddleware<ChannelOrderReq>(param, 'ChannelOrderReq', 'ChannelOrderRsp', 2)
+    return protoMiddleware<ChannelOrderReq>(param, 'ChannelOrderReq', 'ChannelOrderRsp', {
+        AccountID: param.AccountID,
+        MarketID: param.MarketID,
+        GoodsID: param.MarketID,
+    })
 }
 }

+ 7 - 7
src/services/proto/futures/interface.ts

@@ -19,13 +19,13 @@ export interface ChannelOrderReq {
     CloseType: number; // uint32 平仓方式(平仓方式 - 0:无 1:平今 2:平昨)
     CloseType: number; // uint32 平仓方式(平仓方式 - 0:无 1:平今 2:平昨)
     PriceMode: number; // uint32 取价方式 - 1:市价 2: 限价
     PriceMode: number; // uint32 取价方式 - 1:市价 2: 限价
     TimeValidType: number; // uint32 时间有效类型
     TimeValidType: number; // uint32 时间有效类型
-    RelatedID: number; // uint64 关联单号
-    ServiceTime: string; // string 服务端时间
-    validtime: string; // string 有效时间
-    CloseTodayQty: number; // uint64 平今仓数量
-    SpotContractID: number; // uint64 现货合同ID - 为4:套期保值时填写
-    SaleUserID: number; // uint64 业务员ID
-    BizSubjectID: number; // uint64 归属业务部门ID
+    RelatedID?: number; // uint64 关联单号
+    ServiceTime?: string; // string 服务端时间
+    validtime?: string; // string 有效时间
+    CloseTodayQty?: number; // uint64 平今仓数量
+    SpotContractID?: number; // uint64 现货合同ID - 为4:套期保值时填写
+    SaleUserID?: number; // uint64 业务员ID
+    BizSubjectID?: number; // uint64 归属业务部门ID
 }
 }
 
 
 // 交易委托应答 0 3 32
 // 交易委托应答 0 3 32

+ 83 - 269
src/views/information/custom/compoments/add/index.vue

@@ -1,33 +1,15 @@
 <template>
 <template>
   <!-- 平安客户资料 -->
   <!-- 平安客户资料 -->
-  <a-modal class="add-custom"
-           :title="isAdd() ? '新增客户资料' : '修改客户资料'"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           :maskClosable="false"
-           v-if="isPingAnOem()"
-           width="890px">
+  <a-modal class="add-custom" :title="isAdd() ? '新增客户资料' : '修改客户资料'" v-model:visible="visible" @cancel="cancel" centered :maskClosable="false" v-if="isPingAnOem()" width="890px">
     <template #footer>
     <template #footer>
-      <a-button key="submit"
-                class="cancelBtn"
-                :loading="loading"
-                :disabled="loading"
-                @click="submit(1)">完成 </a-button>
+      <a-button key="submit" class="cancelBtn" :loading="loading" :disabled="loading" @click="submit(1)">完成 </a-button>
     </template>
     </template>
-    <a-form class="inlineForm"
-            ref="formRef"
-            :model="formState"
-            :rules="rules">
+    <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
       <a-row :gutter="24">
       <a-row :gutter="24">
 
 
         <a-col :span="12">
         <a-col :span="12">
-          <a-form-item label="客户类型"
-                       name="userinfotype">
-            <a-select class="typeSelect"
-                      style="width: 200px"
-                      v-model:value="formState.userinfotype"
-                      placeholder="请选择客户类型">
+          <a-form-item label="客户类型" name="userinfotype">
+            <a-select class="typeSelect" style="width: 200px" v-model:value="formState.userinfotype" placeholder="请选择客户类型">
               <a-select-option value="1"> 个人 </a-select-option>
               <a-select-option value="1"> 个人 </a-select-option>
               <a-select-option value="2"> 企业 </a-select-option>
               <a-select-option value="2"> 企业 </a-select-option>
             </a-select>
             </a-select>
@@ -35,130 +17,72 @@
         </a-col>
         </a-col>
         <template v-if="!isPersonal()">
         <template v-if="!isPersonal()">
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="企业名称"
-                         name="customername">
-              <a-input class="dialogInput"
-                       v-model:value="formState.customername"
-                       style="width: 200px"
-                       placeholder="请输入企业名称" />
+            <a-form-item label="企业名称" name="customername">
+              <a-input class="dialogInput" v-model:value="formState.customername" style="width: 200px" placeholder="请输入企业名称" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
         </template>
         </template>
         <template v-else>
         <template v-else>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="姓名"
-                         name="username">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.username"
-                       placeholder="请输入姓名" />
+            <a-form-item label="姓名" name="username">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.username" placeholder="请输入姓名" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
         </template>
         </template>
         <a-col :span="12">
         <a-col :span="12">
-          <a-form-item label="点价联系人"
-                       name="contactname">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     v-model:value="formState.contactname"
-                     placeholder="请输入联系人" />
+          <a-form-item label="点价联系人" name="contactname">
+            <a-input class="dialogInput" style="width: 200px" v-model:value="formState.contactname" placeholder="请输入联系人" />
           </a-form-item>
           </a-form-item>
         </a-col>
         </a-col>
         <a-col :span="12">
         <a-col :span="12">
-          <a-form-item label="联系人手机号"
-                       name="mobilephone">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     v-model:value="formState.mobilephone"
-                     placeholder="请输入联系人手机号" />
+          <a-form-item label="联系人手机号" name="mobilephone">
+            <a-input class="dialogInput" style="width: 200px" v-model:value="formState.mobilephone" placeholder="请输入联系人手机号" />
           </a-form-item>
           </a-form-item>
         </a-col>
         </a-col>
       </a-row>
       </a-row>
     </a-form>
     </a-form>
   </a-modal>
   </a-modal>
   <!-- 其他项目客户资料 -->
   <!-- 其他项目客户资料 -->
-  <a-modal class="add-custom"
-           v-else
-           :title="isAdd() ? '新增客户资料' : '修改客户资料'"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           :maskClosable="false"
-           width="890px">
+  <a-modal class="add-custom" v-else :title="isAdd() ? '新增客户资料' : '修改客户资料'" v-model:visible="visible" @cancel="cancel" centered :maskClosable="false" width="890px">
     <template #footer>
     <template #footer>
-      <a-button key="submit"
-                class="cancelBtn"
-                :loading="loading"
-                :disabled="loading"
-                @click="submit(1)">保存草稿 </a-button>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                :disabled="loading"
-                @click="submit(2)">提交审核 </a-button>
+      <a-button key="submit" class="cancelBtn" :loading="loading" :disabled="loading" @click="submit(1)">保存草稿 </a-button>
+      <a-button key="submit" type="primary" :loading="loading" :disabled="loading" @click="submit(2)">提交审核 </a-button>
     </template>
     </template>
-    <a-form class="inlineForm"
-            ref="formRef"
-            :model="formState"
-            :rules="rules">
+    <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
       <a-row :gutter="24">
       <a-row :gutter="24">
         <template v-if="isQianHaiJin()">
         <template v-if="isQianHaiJin()">
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="所属机构"
-                         name="areaid">
-              <a-select class="typeSelect"
-                        style="width: 200px"
-                        v-model:value="formState.areaid"
-                        placeholder="请选择所属机构">
-                <a-select-option v-for="item in areaList"
-                                 :key="item.userid">
+            <a-form-item label="所属机构" name="areaid">
+              <a-select class="typeSelect" style="width: 200px" v-model:value="formState.areaid" placeholder="请选择所属机构">
+                <a-select-option v-for="item in areaList" :key="item.userid">
                   {{ item.accountname }}
                   {{ item.accountname }}
                 </a-select-option>
                 </a-select-option>
               </a-select>
               </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="所属客户经理"
-                         name="teammanageruserid">
-              <a-select class="typeSelect"
-                        style="width: 200px"
-                        v-model:value="formState.teammanageruserid"
-                        placeholder="请选择所属客户经理">
-                <a-select-option v-for="item in brokerList"
-                                 :key="item.userid">
+            <a-form-item label="所属客户经理" name="teammanageruserid">
+              <a-select class="typeSelect" style="width: 200px" v-model:value="formState.teammanageruserid" placeholder="请选择所属客户经理">
+                <a-select-option v-for="item in brokerList" :key="item.userid">
                   {{ item.customername }}
                   {{ item.customername }}
                 </a-select-option>
                 </a-select-option>
               </a-select>
               </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
-          <a-col :span="12"
-                 v-if="!isAdd()">
-            <a-form-item label="登录账号"
-                         name="logincode">
-              <a-input class="dialogInput"
-                       v-model:value="formState.logincode"
-                       style="width: 200px"
-                       placeholder="请选择登录账号" />
+          <a-col :span="12" v-if="!isAdd()">
+            <a-form-item label="登录账号" name="logincode">
+              <a-input class="dialogInput" v-model:value="formState.logincode" style="width: 200px" placeholder="请选择登录账号" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
-          <a-col :span="12"
-                 v-if="!isAdd()">
-            <a-form-item label="登录密码"
-                         name="loginpwd">
-              <a-input class="dialogInput"
-                       v-model:value="formState.loginpwd"
-                       style="width: 200px"
-                       placeholder="请选择登录密码" />
+          <a-col :span="12" v-if="!isAdd()">
+            <a-form-item label="登录密码" name="loginpwd">
+              <a-input class="dialogInput" v-model:value="formState.loginpwd" style="width: 200px" placeholder="请选择登录密码" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
         </template>
         </template>
         <a-col :span="12">
         <a-col :span="12">
-          <a-form-item label="客户类型"
-                       name="userinfotype">
-            <a-select class="typeSelect"
-                      style="width: 200px"
-                      v-model:value="formState.userinfotype"
-                      placeholder="请选择客户类型">
+          <a-form-item label="客户类型" name="userinfotype">
+            <a-select class="typeSelect" style="width: 200px" v-model:value="formState.userinfotype" placeholder="请选择客户类型">
               <a-select-option value="1"> 个人 </a-select-option>
               <a-select-option value="1"> 个人 </a-select-option>
               <a-select-option value="2"> 企业 </a-select-option>
               <a-select-option value="2"> 企业 </a-select-option>
             </a-select>
             </a-select>
@@ -166,174 +90,101 @@
         </a-col>
         </a-col>
         <template v-if="!isPersonal()">
         <template v-if="!isPersonal()">
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="企业名称"
-                         name="customername">
-              <a-input class="dialogInput"
-                       v-model:value="formState.customername"
-                       style="width: 200px"
-                       placeholder="请输入企业名称" />
+            <a-form-item label="企业名称" name="customername">
+              <a-input class="dialogInput" v-model:value="formState.customername" style="width: 200px" placeholder="请输入企业名称" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="企业简称"
-                         name="nickname">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.nickname"
-                       placeholder="请输入企业简称" />
+            <a-form-item label="企业简称" name="nickname">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.nickname" placeholder="请输入企业简称" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="证件类型"
-                         name="cardtype">
-              <a-select class="inlineFormSelect"
-                        v-model:value="formState.cardtype"
-                        style="width: 200px"
-                        placeholder="请选择证件类型">
-                <a-select-option :value="item.enumitemname"
-                                 v-for="item in cardTypeList"
-                                 :key="item.autoid">
+            <a-form-item label="证件类型" name="cardtype">
+              <a-select class="inlineFormSelect" v-model:value="formState.cardtype" style="width: 200px" placeholder="请选择证件类型">
+                <a-select-option :value="item.enumitemname" v-for="item in cardTypeList" :key="item.autoid">
                   {{ item.enumdicname }}
                   {{ item.enumdicname }}
                 </a-select-option>
                 </a-select-option>
               </a-select>
               </a-select>
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="法定代表人"
-                         name="legalpersonname">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.legalpersonname"
-                       placeholder="请输入法定代表人" />
+            <a-form-item label="法定代表人" name="legalpersonname">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.legalpersonname" placeholder="请输入法定代表人" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="证件号码"
-                         name="cardnum">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.cardnum"
-                       placeholder="请输入证件号码" />
+            <a-form-item label="证件号码" name="cardnum">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.cardnum" placeholder="请输入证件号码" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="纳税人识别号"
-                         name="taxpayernum">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.taxpayernum"
-                       placeholder="请输入纳税人识别号" />
+            <a-form-item label="纳税人识别号" name="taxpayernum">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.taxpayernum" placeholder="请输入纳税人识别号" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
             <a-form-item label="营业执照">
             <a-form-item label="营业执照">
-              <UploadImg :visible="visible"
-                         :imgList="attachmentImgList"
-                         @upload="attachmentUpLoad" />
+              <UploadImg :visible="visible" :imgList="attachmentImgList" @upload="attachmentUpLoad" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="联系人"
-                         name="contactname">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.contactname"
-                       placeholder="请输入联系人" />
+            <a-form-item label="联系人" name="contactname">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.contactname" placeholder="请输入联系人" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="联系人手机号"
-                         name="mobilephone">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.mobilephone"
-                       placeholder="请输入联系人手机号" />
+            <a-form-item label="联系人手机号" name="mobilephone">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.mobilephone" placeholder="请输入联系人手机号" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="联系电话"
-                         name="telphone">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.telphone"
-                       placeholder="请输入联系电话" />
+            <a-form-item label="联系电话" name="telphone">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.telphone" placeholder="请输入联系电话" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
 
 
         </template>
         </template>
         <template v-else>
         <template v-else>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="姓名"
-                         name="username">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.username"
-                       placeholder="请输入姓名" />
+            <a-form-item label="姓名" name="username">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.username" placeholder="请输入姓名" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="身份证号码"
-                         name="cardnum">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.cardnum"
-                       placeholder="请输入身份证号码" />
+            <a-form-item label="身份证号码" name="cardnum">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.cardnum" placeholder="请输入身份证号码" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="手机号码"
-                         name="mobilephone">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.mobilephone"
-                       placeholder="请输入手机号码" />
+            <a-form-item label="手机号码" name="mobilephone">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.mobilephone" placeholder="请输入手机号码" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="身份证正面照"
-                         name="cardbackphotourl">
-              <UploadImg :visible="visible"
-                         :imgList="cardfrontImgList"
-                         @upload="cardfrontphotourlUpLoad" />
+            <a-form-item label="身份证正面照" name="cardbackphotourl">
+              <UploadImg :visible="visible" :imgList="cardfrontImgList" @upload="cardfrontphotourlUpLoad" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="邮箱"
-                         name="email">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.email"
-                       placeholder="请输入邮箱" />
+            <a-form-item label="邮箱" name="email">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.email" placeholder="请输入邮箱" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="身份证反面照"
-                         name="cardfrontphotourl">
-              <UploadImg :visible="visible"
-                         :imgList="cardbackImgList"
-                         @upload="cardbackphotourlUpLoad" />
+            <a-form-item label="身份证反面照" name="cardfrontphotourl">
+              <UploadImg :visible="visible" :imgList="cardbackImgList" @upload="cardbackphotourlUpLoad" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
           <a-col :span="12">
           <a-col :span="12">
-            <a-form-item label="联系电话"
-                         name="telphone">
-              <a-input class="dialogInput"
-                       style="width: 200px"
-                       v-model:value="formState.telphone"
-                       placeholder="请输入联系电话" />
+            <a-form-item label="联系电话" name="telphone">
+              <a-input class="dialogInput" style="width: 200px" v-model:value="formState.telphone" placeholder="请输入联系电话" />
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
-          <a-col :span="12"
-                 v-if="isQianHaiJin()">
-            <a-form-item label="性别"
-                         name="sex">
-              <a-select class="inlineFormSelect"
-                        v-model:value="formState.sex"
-                        style="width: 200px"
-                        placeholder="请选择性别">
-                <a-select-option :value="item.id"
-                                 v-for="item in sexList"
-                                 :key="item.id">
+          <a-col :span="12" v-if="isQianHaiJin()">
+            <a-form-item label="性别" name="sex">
+              <a-select class="inlineFormSelect" v-model:value="formState.sex" style="width: 200px" placeholder="请选择性别">
+                <a-select-option :value="item.id" v-for="item in sexList" :key="item.id">
                   {{ item.value }}
                   {{ item.value }}
                 </a-select-option>
                 </a-select-option>
               </a-select>
               </a-select>
@@ -343,16 +194,10 @@
                        placeholder="请选择性别" /> -->
                        placeholder="请选择性别" /> -->
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
-          <a-col :span="12"
-                 v-if="isQianHaiJin()">
+          <a-col :span="12" v-if="isQianHaiJin()">
 
 
-            <a-form-item label="生日"
-                         name="birthday">
-              <a-date-picker v-model:value="formState.birthday"
-                             :allowClear="false"
-                             style="width: 200px"
-                             placeholder="请选择生日"
-                             class="commonDatePicker" />
+            <a-form-item label="生日" name="birthday">
+              <a-date-picker v-model:value="formState.birthday" :allowClear="false" style="width: 200px" placeholder="请选择生日" class="commonDatePicker" />
               <!-- <a-input class="dialogInput"
               <!-- <a-input class="dialogInput"
                        style="width: 200px"
                        style="width: 200px"
                        v-model:value="formState.birthday"
                        v-model:value="formState.birthday"
@@ -365,56 +210,31 @@
         </template>
         </template>
         <a-col :span="24">
         <a-col :span="24">
           <a-form-item label="通讯地址">
           <a-form-item label="通讯地址">
-            <a-select class="inlineFormSelect"
-                      style="width: 205px"
-                      v-model:value="formState.provinceid"
-                      @change="getCityList"
-                      placeholder="请选择省">
-              <a-select-option v-for="item in provinceList"
-                               :key="item.autoid"
-                               :value="item.autoid">
+            <a-select class="inlineFormSelect" style="width: 205px" v-model:value="formState.provinceid" @change="getCityList" placeholder="请选择省">
+              <a-select-option v-for="item in provinceList" :key="item.autoid" :value="item.autoid">
                 {{ item.divisionname }}
                 {{ item.divisionname }}
               </a-select-option>
               </a-select-option>
             </a-select>
             </a-select>
-            <a-select class="inlineFormSelect ml9"
-                      style="width: 205px"
-                      v-model:value="formState.cityid"
-                      @change="getDistrictList"
-                      placeholder="请选择市">
-              <a-select-option v-for="item in cityList"
-                               :key="item.autoid"
-                               :value="item.autoid">
+            <a-select class="inlineFormSelect ml9" style="width: 205px" v-model:value="formState.cityid" @change="getDistrictList" placeholder="请选择市">
+              <a-select-option v-for="item in cityList" :key="item.autoid" :value="item.autoid">
                 {{ item.divisionname }}
                 {{ item.divisionname }}
               </a-select-option>
               </a-select-option>
             </a-select>
             </a-select>
-            <a-select class="inlineFormSelect ml9"
-                      v-model:value="formState.districtid"
-                      style="width: 205px"
-                      placeholder="请选择县(区)">
-              <a-select-option v-for="item in districtList"
-                               :key="item.autoid"
-                               :value="item.autoid">
+            <a-select class="inlineFormSelect ml9" v-model:value="formState.districtid" style="width: 205px" placeholder="请选择县(区)">
+              <a-select-option v-for="item in districtList" :key="item.autoid" :value="item.autoid">
                 {{ item.divisionname }}
                 {{ item.divisionname }}
               </a-select-option>
               </a-select-option>
             </a-select>
             </a-select>
           </a-form-item>
           </a-form-item>
         </a-col>
         </a-col>
         <a-col :span="24">
         <a-col :span="24">
-          <a-form-item label="&nbsp;"
-                       name="cardaddress">
-            <a-input class="dialogInput"
-                     style="width: 635px"
-                     v-model:value="formState.cardaddress"
-                     placeholder="请输入详细地址" />
+          <a-form-item label="&nbsp;" name="cardaddress">
+            <a-input class="dialogInput" style="width: 635px" v-model:value="formState.cardaddress" placeholder="请输入详细地址" />
           </a-form-item>
           </a-form-item>
         </a-col>
         </a-col>
         <a-col :span="24">
         <a-col :span="24">
-          <a-form-item label="备注"
-                       name="remark">
-            <a-input class="dialogInput"
-                     style="width: 635px"
-                     v-model:value="formState.remark"
-                     placeholder="请输入备注" />
+          <a-form-item label="备注" name="remark">
+            <a-input class="dialogInput" style="width: 635px" v-model:value="formState.remark" placeholder="请输入备注" />
           </a-form-item>
           </a-form-item>
         </a-col>
         </a-col>
       </a-row>
       </a-row>
@@ -599,10 +419,4 @@ export default defineComponent({
         };
         };
     },
     },
 });
 });
-</script>
-
-<style lang="less">
-.add-custom {
-}
-</style
->;
+</script>

+ 99 - 27
src/views/market/futures/compoments/futures-trade/index.vue

@@ -5,32 +5,36 @@
       <div class="futures_trade__left">
       <div class="futures_trade__left">
         <a-form class="inlineForm">
         <a-form class="inlineForm">
           <a-form-item label="账号">
           <a-form-item label="账号">
-            <a-select class="inlineFormSelect" placeholder="请选择" v-model:value="formState.accountid">
-              <a-select-option v-for="item in accountList" :value="item.accountid" :key="item.accountid">{{ item.accountid }}</a-select-option>
+            <a-select class="inlineFormSelect" placeholder="请选择" v-model:value="formData.AccountID">
+              <a-select-option v-for="item in accountList" :value="item.accountid" :key="item.accountid">{{ item.accountname }}</a-select-option>
             </a-select>
             </a-select>
           </a-form-item>
           </a-form-item>
           <a-form-item label="合约">
           <a-form-item label="合约">
-            <a-select class="inlineFormSelect" placeholder="请选择" v-model:value="formState.goodscode">
-              <a-select-option v-for="item in tableList" :value="item.goodscode" :key="item.goodscode">{{ item.goodsname }}</a-select-option>
+            <a-select class="inlineFormSelect" placeholder="请选择" v-model:value="formData.GoodsID">
+              <a-select-option v-for="item in tableList" :value="item.goodsid" :key="item.goodsid">{{ item.goodsname }}</a-select-option>
             </a-select>
             </a-select>
           </a-form-item>
           </a-form-item>
           <a-form-item label="交易价格">
           <a-form-item label="交易价格">
-            <a-input-number class="commonInput" />
-            <MinusOutlined @click="decreaseNumber" />
-            <PlusOutlined @click="increaseNumber" />
-            <a-select class="inlineFormSelect" placeholder="请选择"></a-select>
+            <!-- 限价类型不可修改 -->
+            <a-input-number class="commonInput" :value="selectedRow.last" disabled v-if="formData.PriceMode === 2" />
+            <a-input-number class="commonInput" v-model:value="formData.OrderPrice" v-else />
+            <MinusOutlined />
+            <PlusOutlined />
+            <a-select class="inlineFormSelect" placeholder="请选择" v-model:value="selectedPriceMode">
+              <a-select-option v-for="item in priceModeList" :value="item.priceType" :key="item.priceType">{{ item.priceName }}</a-select-option>
+            </a-select>
           </a-form-item>
           </a-form-item>
           <a-form-item label="交易数量">
           <a-form-item label="交易数量">
-            <a-input-number class="commonInput" />
-            <MinusOutlined @click="decreaseNumber" />
-            <PlusOutlined @click="increaseNumber" />
-            <a-button>复位</a-button>
+            <a-input-number class="commonInput" :min="1" v-model:value="formData.OrderQty" />
+            <MinusOutlined />
+            <PlusOutlined />
+            <a-button @click="formData.OrderQty = 1">复位</a-button>
           </a-form-item>
           </a-form-item>
         </a-form>
         </a-form>
         <div>
         <div>
-          <a-button>买入</a-button>
-          <a-button>卖出</a-button>
-          <a-button>平仓</a-button>
+          <a-button :loading="loading" @click="submit('buy')">买入</a-button>
+          <a-button :loading="loading" @click="submit('sell')">卖出</a-button>
+          <a-button :loading="loading" @click="submit('close')">平仓</a-button>
         </div>
         </div>
       </div>
       </div>
       <div class="futures_trade__right">
       <div class="futures_trade__right">
@@ -78,10 +82,16 @@ import Drawer from '@/common/components/drawer/index.vue';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { getAccountTypeList } from '@/services/bus/account';
 import { getAccountTypeList } from '@/services/bus/account';
 import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
 import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
-import moment, { Moment } from 'moment';
-import { defineComponent, PropType, ref } from 'vue';
+import moment from 'moment';
+import { defineComponent, PropType, ref, reactive } from 'vue';
 import { TempTableQuoteDetail } from './interface';
 import { TempTableQuoteDetail } from './interface';
 import { handleForm } from './setup';
 import { handleForm } from './setup';
+import { channelOrderReq } from '@/services/proto/futures';
+import { ChannelOrderReq } from '@/services/proto/futures/interface';
+import { getUserId } from '@/services/bus/user';
+import { geLoginID_number } from '@/services/bus/login';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { v4 as uuidv4 } from 'uuid';
 
 
 export default defineComponent({
 export default defineComponent({
     emits: ['cancel', 'update'],
     emits: ['cancel', 'update'],
@@ -101,20 +111,79 @@ export default defineComponent({
         const { visible, cancel } = _closeModal(context);
         const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef } = handleForm(props.selectedRow);
         const { rules, formState, formRef } = handleForm(props.selectedRow);
         const loading = ref<boolean>(false);
         const loading = ref<boolean>(false);
+
+        // 选中的价格类型
+        const selectedPriceMode = ref(0);
+        // 价格类型列表
+        const priceModeList = [
+            {
+                priceType: 0,
+                priceName: '最新价',
+            },
+            {
+                priceType: 1,
+                priceName: '市价',
+            },
+            {
+                priceType: 2,
+                priceName: '限价',
+            },
+        ];
+
+        const formData = reactive<ChannelOrderReq>({
+            ClientSerialNo: uuidv4(), // string 客户端流水号
+            ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
+            ClientType: 4, // uint32 终端类型
+            LoginID: geLoginID_number()!, // uint64 登陆账号
+            AccountID: 0, // uint64 交易账号
+            GoodsID: props.selectedRow.goodsid, // uint32 商品ID
+            MarketID: props.selectedRow.marketid, // uint32 市场ID
+            ValidType: 1, // int32 有效类型 - 1当日有效
+            ChannelOperateType: 1, // uint32 操作类型:
+            ChannelOrderSrc: 1, // uint32 单据来源委托来源 -  1:客户端 2:管理端 3:风控服务
+            HedgeFlag: 0, // uint32 投机套保标志 - 0:无 1:投机 2:套保 3:套利 4:套期保值 5:单边 6:移仓 7:错单处理 8:跨期套利
+            OperatorID: getUserId(), // uint64 操作员账号ID
+            OrderPrice: 0, // double 委托价格
+            OrderQty: 1, // uint64 委托数量
+            BuyOrSell: 0, // uint32 买卖方向(买卖 - 0:买 1:卖 )
+            ChannelBuildType: 0, // uint32 下单类型(开平标志 - 0:无 1:建仓 2:平仓)
+            CloseType: 0, // uint32 平仓方式(平仓方式 - 0:无 1:平今 2:平昨)
+            PriceMode: 2, // uint32 取价方式 - 1:市价 2: 限价
+            TimeValidType: 1, // uint32 时间有效类型
+        });
+
+        // 账号列表
         const accountList = getAccountTypeList([1]);
         const accountList = getAccountTypeList([1]);
         if (accountList.length) {
         if (accountList.length) {
-            formState.accountid = accountList[0].accountid;
+            formData.AccountID = accountList[0].accountid;
         }
         }
 
 
-        function submit() {
-            // const marketInfo = getMarketRunByTradeMode(17);
-            // if (marketInfo) {
-            //     validateAction<FormParam>(formRef, formState).then((res) => {
-            //         requestResultLoadingAndInfo(hdWROrder, param, loading, ['求购成功', '求购失败:']).then(() => {
-            //             cancel(true);
-            //         });
-            //     });
-            // }
+        function submit(submitType: 'buy' | 'sell' | 'close') {
+            switch (submitType) {
+                case 'buy': {
+                    formData.BuyOrSell = 0;
+                    formData.ChannelBuildType = 1;
+                    break;
+                }
+                case 'sell': {
+                    formData.BuyOrSell = 1;
+                    formData.ChannelBuildType = 1;
+                    break;
+                }
+                case 'close': {
+                    formData.ChannelBuildType = 2;
+                    break;
+                }
+            }
+
+            if (formData.PriceMode === 2) {
+                const { last } = props.selectedRow;
+                formData.OrderPrice = last!;
+            }
+
+            requestResultLoadingAndInfo(channelOrderReq, formData, loading, ['成功', '失败:']).then(() => {
+                cancel(true);
+            });
         }
         }
         return {
         return {
             submit,
             submit,
@@ -125,6 +194,9 @@ export default defineComponent({
             rules,
             rules,
             formState,
             formState,
             formRef,
             formRef,
+            formData,
+            priceModeList,
+            selectedPriceMode,
         };
         };
     },
     },
 });
 });

+ 2 - 0
src/views/market/futures/setup.tsx

@@ -226,9 +226,11 @@ export const useExternalexchange = () => {
         // 重置表格数据
         // 重置表格数据
         tableList.value = goodsList.map((el) => {
         tableList.value = goodsList.map((el) => {
             return {
             return {
+                goodsid: el.goodsid,
                 goodscode: el.goodscode,
                 goodscode: el.goodscode,
                 goodsname: el.goodsname,
                 goodsname: el.goodsname,
                 decimalplace: el.decimalplace,
                 decimalplace: el.decimalplace,
+                marketid: el.marketid,
             }
             }
         })
         })