Explorar el Código

修改现货合同

huangbin hace 4 años
padre
commit
c4b557d749

+ 5 - 4
src/services/proto/spotcontract/index.ts

@@ -1,7 +1,8 @@
-import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
 import APP from "@/services";
-import {Callback} from "@/utils/websocket";
-import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import { getSelectedAccountId } from '@/services/bus/account';
+import { GldErmcpSpotContractOperateReq } from "@/services/proto/spotcontract/interface";
+import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
+import { Callback } from "@/utils/websocket";
 
 /**(重点提醒 这里属于管理端接口,仅用于新增)以上来自android代码  回头需要确认
  * 获取新增采购合同报文
@@ -15,7 +16,7 @@ export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<an
             funCodeName: 'GldErmcpSpotContractOperateReq',
             reqParams: param,
             msgHeadParams: {
-                AccountID: param.accountid,
+                AccountID: getSelectedAccountId() === null ? 0 : getSelectedAccountId(),
                 MarketID: 18,
                 GoodsID: 0,
             }

+ 18 - 19
src/services/proto/spotcontract/interface.ts

@@ -1,9 +1,8 @@
 // 现货合同操作请求 0 29 167
 export interface GldErmcpSpotContractOperateReq {
-    accountid: number  // header
     SpotContractID: number // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
-    OperateType : number // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
-    OperateSrc : number // uint32 操作来源-1:管理端2:终端
+    OperateType: number // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
+    OperateSrc: number // uint32 操作来源-1:管理端2:终端
     UserID: number // uint64 操作用户ID
     Remark: string // string 操作备注
     ClientTicket: string // string 客户端流水号
@@ -24,22 +23,22 @@ export interface GldSpotContractInfo {
     TradeDate: string // string 交易日(yyyyMMdd)
     ContractNo: string // string 现货合同编号
     ContractType: number// int32 现货合同类型-1:采购-1:销售
-    UserID :number // uint64 机构ID
-    BuyUserID :number // uint64 采购方ID
-    SellUserID :number // uint64 客户ID
-    SignDate : string // string 签订日期
-    ContractAttachment : Uint8Array // bytes 合同附件
-    ContractMargin : number // double 合同保证金
-    DeliveryGoodsID : number  // uint64 现货品种ID
-    WrStandardID : number  // uint64 现货商品ID
-    ProductType : number  // uint32 产品类型-1:标准仓单2:等标3:非标
-    ConvertFactor : number  // double 标仓系数
-    SpotGoodsDesc : string // string 商品型号
-    PriceType : number // uint32 定价类型-1:一口价2:点价3:暂定价
-    Qty  : number // double 数量
-    Price : number// double 价格暂定价[1:一口价、3:暂定价]
-    Amount : number // double 金额[1:一口价、3:暂定价]
-    DeliveryStartDate : string// string 交收期(开始)
+    UserID: number // uint64 机构ID
+    BuyUserID: number // uint64 采购方ID
+    SellUserID: number // uint64 客户ID
+    SignDate: string // string 签订日期
+    ContractAttachment: Uint8Array // bytes 合同附件
+    ContractMargin: number // double 合同保证金
+    DeliveryGoodsID: number  // uint64 现货品种ID
+    WrStandardID: number  // uint64 现货商品ID
+    ProductType: number  // uint32 产品类型-1:标准仓单2:等标3:非标
+    ConvertFactor: number  // double 标仓系数
+    SpotGoodsDesc: string // string 商品型号
+    PriceType: number // uint32 定价类型-1:一口价2:点价3:暂定价
+    Qty: number // double 数量
+    Price: number// double 价格暂定价[1:一口价、3:暂定价]
+    Amount: number // double 金额[1:一口价、3:暂定价]
+    DeliveryStartDate: string// string 交收期(开始)
     DeliveryEndDate: string // string 交收期(结束)
     GoodsID: number // uint64 点价合约ID-0:为现货,其它为期货商品合约ID[2:点价3:暂定价]
     PriceMove: number// double 升贴水[2:点价3:暂定价]

+ 27 - 17
src/views/information/spot-contract/components/add/index.vue

@@ -27,6 +27,8 @@
             <a-form-item label="合同编号">
               <a-input class="dialogInput"
                        style="width: 200px"
+                       name="ContractNo"
+                       v-model:value="formState.ContractNo"
                        placeholder="请输入合同编号" />
             </a-form-item>
           </a-col>
@@ -34,12 +36,13 @@
             <a-form-item label="合同类型">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        name="ContractType"
+                        v-model:value="formState.ContractType"
                         placeholder="请选择合同类型">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in contractType"
+                                 :key="item.key"
+                                 :value="item.key">
+                  {{item.value}}
                 </a-select-option>
               </a-select>
             </a-form-item>
@@ -50,12 +53,13 @@
             <a-form-item label="业务类型">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        name="BizType"
+                        v-model:value="formState.BizType"
                         placeholder="请选择业务类型">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in businessType"
+                                 :key="item.key"
+                                 :value="item.key">
+                  {{item.value}}
                 </a-select-option>
               </a-select>
             </a-form-item>
@@ -72,6 +76,7 @@
               <a-select class="inlineFormSelect"
                         style="width: 200px"
                         placeholder="请选择销售方">
+                <!-- 客户资料列表 正常 -->
                 <a-select-option value="1">
                   客户一
                 </a-select-option>
@@ -82,7 +87,8 @@
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="合同附件">
+            <a-form-item label="合同附件"
+                         name="ContractAttachment">
               <div class="upload">
                 <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
                           :transform-file="transformFile">
@@ -165,11 +171,10 @@
               <a-select class="inlineFormSelect"
                         style="width: 200px"
                         placeholder="请选择定价类型">
-                <a-select-option value="1">
-                  点价
-                </a-select-option>
-                <a-select-option value="2">
-                  一口价
+                <a-select-option v-for="item in priceType"
+                                 :key="item.key"
+                                 :value="item.key">
+                  {{item.value}}
                 </a-select-option>
               </a-select>
             </a-form-item>
@@ -357,6 +362,7 @@
 import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods';
+import { handleFromState } from './setup';
 
 export default defineComponent({
     name: 'add-spot-contract',
@@ -367,7 +373,7 @@ export default defineComponent({
 
         // 表单
         const formRef = ref();
-        // const { formState, addOne, deleteOne } = handleFromState();
+        const { formState, contractType, priceType, businessType } = handleFromState();
         // const rules = {
         //     deliverygoodsname: [{ required: true, message: '请输入现货品种名称', trigger: 'blur' }],
         //     // unitid: [{ required: true, message: '请选择单位', trigger: 'change' }],
@@ -400,6 +406,10 @@ export default defineComponent({
             submit,
             loading,
             maskClosableFlag: false,
+            contractType,
+            priceType,
+            businessType,
+            formState,
         };
     },
 });

+ 37 - 0
src/views/information/spot-contract/components/add/interface.ts

@@ -0,0 +1,37 @@
+export interface FormState {
+    // TradeDate: string // string 交易日(yyyyMMdd)
+    ContractNo: string // string 现货合同编号
+    ContractType: number// int32 现货合同类型-1:采购-1:销售
+    // UserID: number // uint64 机构ID
+    BuyUserID: number // uint64 采购方ID
+    SellUserID: number // uint64 客户ID
+    // SignDate: string // string 签订日期
+    ContractAttachment: Uint8Array // bytes 合同附件
+    ContractMargin: number | null // double 合同保证金
+    DeliveryGoodsID: number | undefined  // uint64 现货品种ID
+    WrStandardID: number | undefined   // uint64 现货商品ID
+    // ProductType: number  // uint32 产品类型-1:标准仓单2:等标3:非标
+    ConvertFactor: number | undefined  // double 标仓系数
+    SpotGoodsDesc: string // string 商品型号
+    PriceType: number // uint32 定价类型-1:一口价2:点价3:暂定价
+    Qty: number | null // double 数量
+    Price: number | null// double 价格暂定价[1:一口价、3:暂定价]
+    Amount: number | null// double 金额[1:一口价、3:暂定价]
+    DeliveryStartDate: string// string 交收期(开始)
+    DeliveryEndDate: string // string 交收期(结束)
+    // GoodsID: number // uint64 点价合约ID-0:为现货,其它为期货商品合约ID[2:点价3:暂定价]
+    // PriceMove: number// double 升贴水[2:点价3:暂定价]
+    // StartDate: string // string 点价开始日期[2:点价3:暂定价]
+    // EndDate: string // string 点价结束日期[2:点价3:暂定价]
+    // PointDesc: string // string 点价备注[2:点价3:暂定价]
+    // DeliveryDesc: string  // string 交收方式
+    MerUserID: number | undefined // uint64 跟单员ID
+    // TradeUserID: number // uint64 交易员ID
+    // PricedQty: number // double 已定价量
+    // PricedAmount: number // double 已定价金额
+    SpotGoodsBrandID: number | undefined // uint64 现货品牌ID
+    Remark: string // string 合同备注
+    SaleUserID: number | undefined // uint64 业务员ID
+    AccountID: number | undefined // uint64 期货账户ID
+    BizType: number // uint32 业务类型 - 1:套保 2:套利
+}

+ 44 - 1
src/views/information/spot-contract/components/add/setup.ts

@@ -1,3 +1,46 @@
-export function handleFromState() {
+import { reactive, UnwrapRef } from 'vue';
+import { FormState } from "./interface";
 
+export function handleFromState() {
+    const formState: UnwrapRef<FormState> = reactive({
+        ContractNo: '', // 现货合同编号
+        ContractType: 1, // int32 现货合同类型-1:采购-1:销售
+        BizType: 1, // uint32 业务类型 - 1:套保 2:套利
+        BuyUserID: 0, // uint64 采购方ID
+        SellUserID: 0,// uint64 客户ID
+        ContractAttachment: new Uint8Array(),// bytes 合同附件
+        DeliveryGoodsID: undefined, // 现货品种ID
+        WrStandardID: undefined,  // uint64 现货商品ID
+        SpotGoodsBrandID: undefined, // uint64 现货品牌ID
+        ConvertFactor: undefined,// double 标仓系数
+        SpotGoodsDesc: '', // string 商品型号
+        PriceType: 1, // uint32 定价类型-1:一口价2:点价3:暂定价
+        Qty: null, // double 数量
+        Price: null,// double 价格暂定价[1:一口价、3:暂定价]
+        Amount: null, // double 金额[1:一口价、3:暂定价]
+        DeliveryStartDate: '', // string 交收期(开始)
+        DeliveryEndDate: '', // string 交收期(结束)
+        ContractMargin: null, // double 合同保证金
+        SaleUserID: undefined, // uint64 业务员ID
+        MerUserID: undefined, // uint64 跟单员ID
+        AccountID: undefined, // uint64 期货账户ID
+        Remark: '' // string 合同备注
+    })
+    // 合同类型
+    const contractType = [
+        { key: 1, value: '采购' },
+        { key: -1, value: '销售' },
+    ];
+    // 定价类型
+    const priceType = [
+        { key: 1, value: '一口价' },
+        { key: 2, value: '点价' },
+        { key: 3, value: '暂定价' },
+    ];
+    // 业务类型
+    const businessType = [
+        { key: 1, value: '套保' },
+        { key: 2, value: '套利' },
+    ];
+    return { formState, contractType, priceType, businessType }
 }