فهرست منبع

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

marymelisa 4 سال پیش
والد
کامیت
b4877c614a
39فایلهای تغییر یافته به همراه1921 افزوده شده و 920 حذف شده
  1. 60 16
      public/proto/mtp.proto
  2. 5 2
      src/common/methods/request/index.ts
  3. 22 0
      src/common/methods/request/resultInfo.ts
  4. 3 0
      src/services/funcode/index.ts
  5. 1 1
      src/services/go/ermcp/plan/index.ts
  6. 14 3
      src/services/go/ermcp/plan/interface.ts
  7. 59 56
      src/services/go/ermcp/spot-contract/interface.ts
  8. 48 8
      src/services/proto/hedgeplan/index.ts
  9. 49 14
      src/services/proto/hedgeplan/interface.ts
  10. 0 1
      src/services/proto/spotcontract/index.ts
  11. 25 25
      src/services/proto/spotcontract/interface.ts
  12. 1 0
      src/services/socket/protobuf/buildReq.ts
  13. 13 1
      src/services/socket/protobuf/index.ts
  14. 140 100
      src/views/business/plan/components/audit/index.vue
  15. 129 30
      src/views/business/plan/components/cancel/index.vue
  16. 104 8
      src/views/business/plan/components/delete/index.vue
  17. 94 70
      src/views/business/plan/components/detail/index.vue
  18. 29 0
      src/views/business/plan/components/setup.ts
  19. 61 40
      src/views/business/plan/list/audit/index.vue
  20. 60 40
      src/views/business/plan/list/running/index.vue
  21. 64 44
      src/views/business/plan/list/uncommitted/index.vue
  22. 52 1
      src/views/business/plan/setup.ts
  23. 51 52
      src/views/information/spot-contract/components/add/index.vue
  24. 1 1
      src/views/information/spot-contract/components/add/interface.ts
  25. 93 74
      src/views/information/spot-contract/components/add/setup.ts
  26. 10 3
      src/views/information/spot-contract/components/cancel/index.vue
  27. 100 71
      src/views/information/spot-contract/components/check/index.vue
  28. 11 0
      src/views/information/spot-contract/components/check/interface.ts
  29. 31 16
      src/views/information/spot-contract/components/check/setup.ts
  30. 10 3
      src/views/information/spot-contract/components/delete/index.vue
  31. 10 4
      src/views/information/spot-contract/components/finish/index.vue
  32. 100 64
      src/views/information/spot-contract/components/setup.ts
  33. 1 1
      src/views/manage/business-review/components/settlementDetail/index.vue
  34. 103 22
      src/views/manage/business-review/components/somepriceAudit/index.vue
  35. 119 41
      src/views/manage/business-review/components/somepriceCancel/index.vue
  36. 105 28
      src/views/manage/business-review/components/somepriceDetail/index.vue
  37. 48 40
      src/views/manage/business-review/list/settlement/index.vue
  38. 70 40
      src/views/manage/business-review/list/someprice/index.vue
  39. 25 0
      src/views/manage/business-review/setup.ts

+ 60 - 16
public/proto/mtp.proto

@@ -883,22 +883,30 @@ message ErmcpContractOperateApplyInfo {
 }
 // 套保计划请求 0 29 164
 message ErmcpHedgePlanReq {
-	optional MessageHead Header = 1; // MessageHead
-	optional uint64 HedgePlanID = 2; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
-		optional string HedgePlanNo = 3; // string 套保计划名称
-		optional int32 ContractType = 4; // int32 计划类型-1:采购-1:销售
-		optional uint64 AreaUserID = 5; // uint64 机构ID
-		optional uint64 DeliveryGoodsID = 6; // uint64 现货品种ID
-		optional int32 ProductType = 7; // int32 产品类型-1:标准仓单2:等标3:非标
-		optional string SpotGoodsDesc = 8; // string 商品型号
-		optional double PlanQty = 9; // double 计划数量
-		optional double ConvertFactor = 10; // double 标仓系数
-		optional string PlanTime = 11; // string 计划时间
-		optional string TradeDate = 12; // string 交易日(yyyyMMdd)
-		optional int32 ApplySrc = 13; // int32 申请来源 - 1:管理端 2:终端
-		optional uint64 ApplyId = 14; // uint64 申请人
-		optional string Remark = 15; // string 计划备注
-	optional int32 OperateType = 16; // int32 操作类型-1:保存草稿2:提交申请
+ optional MessageHead Header = 1; // MessageHead
+ optional uint64 HedgePlanID = 2; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+ optional string HedgePlanNo = 3; // string 套保计划名称
+ optional int32 ContractType = 4; // int32 计划类型-1:采购-1:销售
+ optional uint64 AreaUserID = 5; // uint64 机构ID
+ optional uint64 DeliveryGoodsID = 6; // uint64 现货品种ID
+ optional int32 ProductType = 7; // int32 产品类型-1:标准仓单2:等标3:非标
+ optional string SpotGoodsDesc = 8; // string 商品型号
+ optional double PlanQty = 9; // double 计划数量
+ optional double ConvertFactor = 10; // double 标仓系数
+ optional string PlanTime = 11; // string 计划时间
+ optional string TradeDate = 12; // string 交易日(yyyyMMdd)
+ optional int32 ApplySrc = 13; // int32 申请来源 - 1:管理端 2:终端
+ optional uint64 ApplyId = 14; // uint64 申请人
+ optional string Remark = 15; // string 计划备注
+ optional int32 OperateType = 16; // int32 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
+ optional uint64 WRStandardID = 17; // uint64 现货品类ID
+ optional uint64 AccountID = 18; // uint64 期货账户ID(默认为0,也可不传)
+ optional uint64 Tradeuserid = 19; // uint64 交易用户ID
+ optional uint64 Currencyid = 20; // uint64 结算币种ID
+ optional uint64 Biztype = 21; // uint64 业务类型 - 1:套保 2:套利 默认为 1
+ optional uint64 auditid = 22; // uint64 审核人
+ optional uint32 auditsrc = 23; // uint32 审核来源 - 1:管理端 2:终端
+ optional string auditremark = 24; // string 审核备注
 }
 // 套保计划响应 0 29 165
 message ErmcpHedgePlanRsp {
@@ -987,4 +995,40 @@ message SpotContractInfo {
 	optional uint32 RelatedUserID = 37; // uint32 关联用户ID
 }
 
+// 套保计划操作请求 0 18 2
+message HedgePlanOperateReq {
+	optional MessageHead Header = 1; // MessageHead
+	optional uint64 HedgePlanID = 2; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+	optional uint32 OperateType = 3; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+	optional uint32 OperateSrc = 4; // uint32 操作来源-1:管理端2:终端
+	optional uint64 UserID = 5; // uint64 操作用户ID
+	optional string Remark = 6; // string 备注
+	optional string ClientTicket = 7; // string 客户端流水号
+	optional HedgePlanInfo Info = 8; // HedgePlanInfo 套保计划信息
+}
+// 套保计划操作响应 0 18 3
+message HedgePlanOperateRsp {
+	optional MessageHead Header = 1; // MessageHead 消息头
+	optional int32 RetCode = 2; // int32 返回码
+	optional string RetDesc = 3; // string 描述信息
+	optional uint64 HedgePlanID = 4; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+	optional uint32 OperateType = 5; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+	optional uint32 OperateSrc = 6; // uint32 操作来源-1:管理端2:终端
+	optional string ClientTicket = 7; // string 客户端流水号
+}
+
+// 套保计划信息 0 18 1
+message HedgePlanInfo {
+	optional string HedgePlanNo = 1; // string 套保计划编号
+	optional int32 ContractType = 2; // int32 计划类型-1:采购-1:销售
+	optional uint32 AreaUserID = 3; // uint32 机构ID
+	optional uint32 DeliveryGoodsID = 4; // uint32 现货品种ID
+	optional uint32 WrStandardID = 5; // uint32 现货商品ID
+	optional uint32 ProductType = 6; // uint32 产品类型-1:标准仓单2:等标3:非标
+	optional string SpotGoodsDesc = 7; // string 商品型号
+	optional double PlanQty = 8; // double 计划数量
+	optional double ConvertFactor = 9; // double 标仓系数
+	optional string PlanTime = 10; // string 计划时间
+}
+
 

+ 5 - 2
src/common/methods/request/index.ts

@@ -1,2 +1,5 @@
-import { getRequestResultInfo } from './resultInfo'
-export { getRequestResultInfo }
+import { ResultInfo } from './interface'
+import { commonResultInfo, getRequestResultInfo } from './resultInfo'
+export { getRequestResultInfo, commonResultInfo }
+export type { ResultInfo }
+

+ 22 - 0
src/common/methods/request/resultInfo.ts

@@ -1,3 +1,5 @@
+import { message } from 'ant-design-vue'
+import { Ref } from 'vue'
 import { ResultInfo } from './interface'
 /**
  * 获取请求接口时候成功或者失败信息
@@ -12,4 +14,24 @@ export function getRequestResultInfo(map: Map<number, ResultInfo>, type: number)
     } else {
         return ['成功', '失败']
     }
+}
+
+/**
+ * 请求接口通用信息处理(此方法用于不关心请求结果,只关心成功或者失败状态)
+ * @param fn 处理服务接口的函数
+ * @param sign 自定义成功和失败的信息
+ * @param loading loading状态
+ */
+export function commonResultInfo(fn: Promise<any>, sign: ResultInfo, loading: Ref<boolean>): Promise<string> {
+    return fn.then(() => {
+        message.success(sign[0])
+        return Promise.resolve(sign[0])
+    })
+        .catch((err: string) => {
+            console.warn(`${fn}调用失败: err`);
+            message.error(sign[1] + err)
+            return Promise.reject(sign[1] + err)
+        }).finally(() => {
+            loading.value = false
+        })
 }

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

@@ -88,6 +88,9 @@ export const funCode: Code = {
     // 套保计划 -- 新增套保计划
     ErmcpHedgePlanReq: 1900708,  /// 套保计划操作请求(1179650)
     ErmcpHedgePlanRsp: 1900709,  /// 套保计划操作响应(1179651)
+    // 套保计划 -- (old接口)
+    HedgePlanOperateReq: 1179650, /// 套保计划操作请求(1179650)
+    HedgePlanOperateRsp: 1179651, /// 套保计划操作响应(1179651)
 
     // 信息 - 客户资料 - 审核
     UserInfoCheckMangeReq: 1900666,    /// 客户信息审核通过请求

+ 1 - 1
src/services/go/ermcp/plan/index.ts

@@ -12,7 +12,7 @@ import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 export function QueryHedgePlan(hedgeplanstatus: string): Promise<Ermcp3HedgePlan[]> {
     const param = {
         userid: getUserId(),
-        hedgeplanstatus
+        hedgeplanstatus: hedgeplanstatus,
     }
     return commonSearch_go('/Ermcp3/QueryHedgePlan', param).catch((err) => {
         throw new Error(`查询套保计划: ${err.message}`);

+ 14 - 3
src/services/go/ermcp/plan/interface.ts

@@ -1,13 +1,16 @@
 export interface Ermcp3HedgePlan{
+    accountid	:number;//资金账号
     areauserid	:number;//用户ID
     audittime	:string;//审核时间
     contracttype	:number;//计划类型 - 1:采购 -1:销售
     convertfactor	:number;//标仓系数
     createtime	:string;//创建时间
+    currencyid	:number;//币种id
+    currencyname	:string;//币种名称
     deliverygoodscode	:string;//现货品种代码
     deliverygoodsid	:number;//现货品种ID
-    deliverygoodsname	:string;//现货品种名称8
-    enumdicname	:string;//单位名称
+    deliverygoodsname	:string;//现货品种名称
+    enumdicname	:string;//单位名称(现货商品)
     hedgeplanid	:string;//套保计划ID(6number;
 //1+Unix秒时间戳(1number;
 //位)+xxxxxx)
@@ -19,6 +22,14 @@ export interface Ermcp3HedgePlan{
     producttype	:number;//产品类型 - 1:标准仓单 2:等标 3:非标
     remark	:string;//备注
     spotgoodsdesc	:string;//商品型号
-    unitid	:number;//单位id
+    taaccountname	:string;//资金账号名称
+    tradeuserid	:number;//交易用户id
+    tradeusername	:string;//交易用户名称
+    unitid	:number;//单位id(现货商品)
     updatetime	:string;//更新时间
+    wrstandardcode	:string;//品类代码
+    wrstandardid	:number;//品类id
+    wrstandardname	:string;//品类名称
+    wrunitid	:number;//品类单位id
+    wrunitidame	:string;//品类单位名称
 }

+ 59 - 56
src/services/go/ermcp/spot-contract/interface.ts

@@ -11,60 +11,63 @@ export interface Ermcp3ContractReq {
  * 现货合同返回
  */
 export interface Ermcp3ContractRsp {
-    accountid: string;//期货账户id
-    amount: number;//金额 [1:一口价、3:暂定价]
-    attachment: string;//附件
-    auditremark: string;//审核意见
-    audittime: string;//审核时间
-    biztype: number;//业务类型 1-套保 2-套利
-    brandname: string;//品牌名称
-    buynickname: string;//销售方昵称
-    buyuserid: number;//采购方ID
-    buyusername: string;//采购方名称
-    contracctstatus: number;//合同状态 - number;
-    //:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
-    contractmargin: number;//合同保证金
-    contractno: string;//现货合同编号
-    contracttype: number;//现货合同类型 - 1:采购 -1:销售
-    convertfactor: number;//标仓系数(品类)
-    createtime: string;//创建时间
-    deliveryenddate: string;//交收期(结束)
-    deliverygoodscode: string;//现货品种代码
-    deliverygoodsid: number;//现货品种ID
-    deliverygoodsname: string;//现货品种名称
-    deliverystartdate: string;//交收期(开始)
-    enddate: string;//点价结束日期 [2:点价 3:暂定价]
-    enumdicname: string;//单位名称
-    goodscode: string;//点价合约代码
-    goodsid: number;//点价合约ID - number;
-    //:为现货,其它为期货商品合约ID [2:点价 3:暂定价]
-    goodsname: string;//点价商品名称
-    margin: number;//当前保证金
-    meruserid: number;//跟单员id
-    meruserlogincode: string;//跟单员登录代码
-    price: number;//价格\暂定价 [1:一口价、3:暂定价]
-    pricemove: number;//升贴水 [2:点价 3:暂定价]
-    pricetype: number;//定价类型 - 1:一口价 2:点价 3:暂定价
-    producttype: number;//产品类型 - 1:标准仓单 2:等标 3:非标
-    qty: number;//数量
-    remark: string;//备注
-    saleuserid: number;//业务员id
-    saleuserlogincode: string;//业务员登录代码
-    sellnickname: string;//采购方昵称
-    selluserid: number;//销售方ID
-    sellusername: string;//销售方名称
-    spotcontractid: string;//现货合同ID(6number;
-    //2+Unix秒时间戳(1number;
-    //位)+xxxxxx)
-    spotgoodsbrandid: number;//现货品牌ID(DGFactoryItem表的ID)
-    spotgoodsdesc: string;//商品型号
-    startdate: string;//点价开始日期 [2:点价 3:暂定价]
-    tradeuserid: number;//交易员id
-    tradeuserlogincode: string;//交易员登录代码
-    unitid: number;//单位id(取品类上的单位id)
-    updatetime: string;//更新时间
-    userid: number;//所属机构ID
-    wrstandardcode: string;//品类代码
-    wrstandardid: number;//品类ID
-    wrstandardname: string;//品类名称
+    accountid	:string;//期货账户id
+    amount	:number;//金额 [1:一口价、3:暂定价]
+    attachment	:string;//附件
+    auditremark	:string;//审核意见
+    audittime	:string;//审核时间
+    biztype	:number;//业务类型 1-套保 2-套利
+    brandname	:string;//品牌名称
+    buynickname	:string;//销售方昵称
+    buyuserid	:number;//采购方ID
+    buyusername	:string;//采购方名称
+    contracctstatus	:number;//合同状态 - number;
+//:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+    contractmargin	:number;//合同保证金
+    contractno	:string;//现货合同编号
+    contracttype	:number;//现货合同类型 - 1:采购 -1:销售
+    convertfactor	:number;//标仓系数(品类)
+    createtime	:string;//创建时间
+    currencyid	:number;//币种id
+    currencyname	:string;//币种名称
+    deliveryenddate	:string;//交收期(结束)
+    deliverygoodscode	:string;//现货品种代码
+    deliverygoodsid	:number;//现货品种ID
+    deliverygoodsname	:string;//现货品种名称
+    deliverystartdate	:string;//交收期(开始)
+    enddate	:string;//点价结束日期 [2:点价 3:暂定价]
+    enumdicname	:string;//单位名称
+    goodscode	:string;//点价合约代码
+    goodsid	:number;//点价合约ID - number;
+//:为现货,其它为期货商品合约ID [2:点价 3:暂定价]
+    goodsname	:string;//点价商品名称
+    margin	:number;//当前保证金
+    meruserid	:number;//跟单员id
+    meruserlogincode	:string;//跟单员登录代码
+    price	:number;//价格\暂定价 [1:一口价、3:暂定价]
+    pricemove	:number;//升贴水 [2:点价 3:暂定价]
+    pricetype	:number;//定价类型 - 1:一口价 2:点价 3:暂定价
+    producttype	:number;//产品类型 - 1:标准仓单 2:等标 3:非标
+    qty	:number;//数量
+    remark	:string;//备注
+    saleuserid	:number;//业务员id
+    saleuserlogincode	:string;//业务员登录代码
+    sellnickname	:string;//采购方昵称
+    selluserid	:number;//销售方ID
+    sellusername	:string;//销售方名称
+    spotcontractid	:string;//现货合同ID(6number;
+//2+Unix秒时间戳(1number;
+//位)+xxxxxx)
+    spotgoodsbrandid	:number;//现货品牌ID(DGFactoryItem表的ID)
+    spotgoodsdesc	:string;//商品型号
+    startdate	:string;//点价开始日期 [2:点价 3:暂定价]
+    tradeuserid	:number;//交易员id
+    tradeuserlogincode	:string;//交易员登录代码
+    tradeusername	:string;//交易员名称
+    unitid	:number;//单位id(取品类上的单位id)
+    updatetime	:string;//更新时间
+    userid	:number;//所属机构ID
+    wrstandardcode	:string;//品类代码
+    wrstandardid	:number;//品类ID
+    wrstandardname	:string;//品类名称
 }

+ 48 - 8
src/services/proto/hedgeplan/index.ts

@@ -1,22 +1,28 @@
 // 套保计划
-import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
 import APP from "@/services";
-import {Callback} from "@/utils/websocket";
-import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
+import { getSelectedAccountId, getUserId } from "@/services/bus/account";
+import { ErmcpHedgePlanReq } from "@/services/proto/hedgeplan/interface";
+import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
+import { Callback } from "@/utils/websocket";
+import moment from "moment";
+import { v4 as uuidv4 } from "uuid";
 
 /**
  * 套保计划操作请求
  * @param param.hedgePlanID Long 套保计划id
- * @param param.OperateType Int 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+ * @param param.OperateType Int 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
  */
-export const operationContractReq = (param: ErmcpHedgePlanReq): Promise<any> => {
+export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
+    param.ApplySrc = 2; // 申请来源 - 1:管理端 2:终端
+    param.TradeDate = moment().format("YYMMDD");
+
     return new Promise((resolve, reject) => {
         const params = {
             protobufName: 'ErmcpHedgePlanReq',
             funCodeName: 'ErmcpHedgePlanReq',
-            reqParams:  param,
+            reqParams: param,
             msgHeadParams: {
-                AccountID: param.accountid,
+                AccountID: getSelectedAccountId(),
                 MarketID: 18,
                 GoodsID: 0,
             }
@@ -34,4 +40,38 @@ export const operationContractReq = (param: ErmcpHedgePlanReq): Promise<any> =>
             onFail: (err) => reject(err.message),
         } as Callback);
     });
-}
+}
+
+/**
+ * 老的计划操作接口 我只负责撤销 传5则进行撤销 !!!!! 注意
+ * @param param
+ */
+export const oldHedgePlanReq = (param: any): Promise<any> => {
+    param.OperateSrc = 2; // 操作来源-1:管理端2:终端
+    param.ClientTicket = uuidv4(); // 流水号
+    param.UserID = getUserId()
+    return new Promise((resolve, reject) => {
+        const params = {
+            protobufName: 'HedgePlanOperateReq',
+            funCodeName: 'HedgePlanOperateReq',
+            reqParams: param,
+            msgHeadParams: {
+                AccountID: getSelectedAccountId(),
+                MarketID: 18,
+                GoodsID: 0,
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'HedgePlanOperateRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
+}

+ 49 - 14
src/services/proto/hedgeplan/interface.ts

@@ -1,20 +1,19 @@
 // 套保计划请求 0 29 164
 export interface ErmcpHedgePlanReq {
-    accountid: string  // header 需要用到
     HedgePlanID: number // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
-    HedgePlanNo: string // string 套保计划名称
-    ContractType: number // int32 计划类型-1:采购-1:销售
-    AreaUserID: number// uint64 机构ID
-    DeliveryGoodsID: number// uint64 现货品种ID
-    ProductType: number // int32 产品类型-1:标准仓单2:等标3:非标
-    SpotGoodsDesc: string // string 商品型号
-    PlanQty: number // double 计划数量
-    ConvertFactor: number // double 标仓系数
-    PlanTime: string // string 计划时间
-    TradeDate: string // string 交易日(yyyyMMdd)
-    ApplySrc: number // int32 申请来源 - 1:管理端 2:终端
-    ApplyId: number // uint64 申请人
-    Remark: string // string 计划备注
+    HedgePlanNo?: string // string 套保计划名称
+    ContractType?: number // int32 计划类型-1:采购-1:销售
+    AreaUserID?: number// uint64 机构ID
+    DeliveryGoodsID?: number// uint64 现货品种ID
+    ProductType?: number // int32 产品类型-1:标准仓单2:等标3:非标
+    SpotGoodsDesc?: string // string 商品型号
+    PlanQty?: number // double 计划数量
+    ConvertFactor?: number // double 标仓系数
+    PlanTime?: string // string 计划时间
+    TradeDate?: string // string 交易日(yyyyMMdd)
+    ApplySrc?: number // int32 申请来源 - 1:管理端 2:终端
+    ApplyId?: number // uint64 申请人
+    Remark?: string // string 计划备注
     OperateType: number // int32 操作类型-1:保存草稿2:提交申请
 }
 
@@ -22,4 +21,40 @@ export interface ErmcpHedgePlanReq {
 export interface  ErmcpHedgePlanRsp {
     RetCode: number // int32 返回码
     RetDesc: string // string 描述信息
+}
+
+
+// 套保计划操作请求 0 18 2
+export interface HedgePlanOperateReq {
+    HedgePlanID: number; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+    OperateType: number; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+    OperateSrc?: number; // uint32 操作来源-1:管理端2:终端
+    UserID?: number; // uint64 操作用户ID
+    Remark?: string; // string 备注
+    ClientTicket?: string; // string 客户端流水号
+    Info?: HedgePlanInfo; // HedgePlanInfo 套保计划信息
+}
+
+// 套保计划操作响应 0 18 3
+export interface  HedgePlanOperateRsp {
+    RetCode: number; // int32 返回码
+    RetDesc: string; // string 描述信息
+    HedgePlanID: number; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+    OperateType: number; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+    OperateSrc: number; // uint32 操作来源-1:管理端2:终端
+    ClientTicket: string; // string 客户端流水号
+}
+
+// 套保计划信息 0 18 1
+export interface  HedgePlanInfo {
+    HedgePlanNo: string; // string 套保计划编号
+    ContractType: number; // int32 计划类型-1:采购-1:销售
+    AreaUserID: number; // uint32 机构ID
+    DeliveryGoodsID: number; // uint32 现货品种ID
+    WrStandardID: number; // uint32 现货商品ID
+    ProductType: number; // uint32 产品类型-1:标准仓单2:等标3:非标
+    SpotGoodsDesc: string; // string 商品型号
+    PlanQty: number; // double 计划数量
+    ConvertFactor: number; // double 标仓系数
+    PlanTime: string; // string 计划时间
 }

+ 0 - 1
src/services/proto/spotcontract/index.ts

@@ -34,7 +34,6 @@ export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<an
         APP.sendTradingServer(package50, undefined, {
             onSuccess: (res) => {
                 const { isSuccess, result } = parseProtoRsp50(res, 'GldErmcpSpotContractOperateRsp');
-                debugger
                 if (isSuccess) {
                     resolve(result);
                 } else {

+ 25 - 25
src/services/proto/spotcontract/interface.ts

@@ -1,6 +1,6 @@
 // 现货合同操作请求 0 29 167
 export interface GldErmcpSpotContractOperateReq {
-    SpotContractID: number // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
+    SpotContractID: string // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
     OperateType: number // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
     Remark: string // string 操作备注
     Info?: GldSpotContractInfo // GldSpotContractInfo 现货合同信息
@@ -26,28 +26,28 @@ export interface GldErmcpSpotContractOperateRsp {
 
 // 现货合同信息 0 29 166
 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 签订日期
+    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 交收期(开始)
-    DeliveryEndDate: string // string 交收期(结束)
-    GoodsID: number // uint64 点价合约ID-0:为现货,其它为期货商品合约ID[2:点价3:暂定价]
-    PriceMove: number// double 升贴水[2:点价3:暂定价]
+    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:暂定价]
     StartDate?: string // string 点价开始日期[2:点价3:暂定价]
     EndDate?: string // string 点价结束日期[2:点价3:暂定价]
     PointDesc?: string // string 点价备注[2:点价3:暂定价]
@@ -56,17 +56,17 @@ export interface GldSpotContractInfo {
     TradeUserID?: number // uint64 交易员ID
     PricedQty?: number // double 已定价量
     PricedAmount?: number // double 已定价金额
-    SpotGoodsBrandID: number // uint64 现货品牌ID
+    SpotGoodsBrandID?: number // uint64 现货品牌ID
     Remark?: string // string 合同备注
     SaleUserID?: number // uint64 业务员ID
     AccountID?: number // uint64 期货账户ID
     BizType?: number // uint32 业务类型 - 1:套保 2:套利
-    CurrencyID: number // 结算币种ID
+    CurrencyID?: number // 结算币种ID
 }
 
 //现货合同操作请求  (一部分操作用这个借口)
 export interface SpotContractOperateReq {
-    SpotContractID: number; // 现货合同id
+    SpotContractID: string; // 现货合同id
     OperateType: number; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
     Remark: string; // string 操作备注
     Info?: SpotContractInfo; // SpotContractInfo 现货合同信息
@@ -99,7 +99,7 @@ export interface SpotContractInfo {
     PointDesc: string; // string 点价备注[2:点价3:暂定价]
     DeliveryDesc: string; // string 交收方式
     MerUserID: number; // uint32 跟单员ID
-    TradeUserID : number; // uint32 交易员ID
+    TradeUserID: number; // uint32 交易员ID
     PricedQty: number; // double 已定价量
     PricedAmount: number; // double 已定价金额
     SpotGoodsBrandID: number; // uint32 现货品牌ID

+ 1 - 0
src/services/socket/protobuf/buildReq.ts

@@ -70,6 +70,7 @@ function buildSoleProtoReq(protobufName: string, reqParams: type.ReqParams) {
     ReqKeys.forEach((e) => {
         ReqKeysMap.set(e.toLowerCase(), e);
     });
+    // 此处需要待优化,proto嵌套的时候存在问题
     const paramKeys = Object.keys(reqParams);
     for (let i = 0; i < paramKeys.length; i++) {
         const item = paramKeys[i];

+ 13 - 1
src/services/socket/protobuf/index.ts

@@ -2,7 +2,7 @@
 import Protobuf from 'protobufjs';
 class ProtobufCtr {
     protoBufer: any;
-    constructor() {}
+    constructor() { }
     /**
      * 加载proto文件
      * @param {*} proto 导入的proto
@@ -28,6 +28,18 @@ class ProtobufCtr {
         if (this.protoBufer) {
             const RootProto = this.protoBufer.build(protoName);
             const instenceProto = new RootProto();
+            const set = new WeakSet()
+            // 处理 proto 嵌套问题
+            RootProto.$type.children.forEach((el: any) => {
+                const { resolvedType, name } = el;
+                if (resolvedType && typeof resolvedType === 'object') {
+                    if (!set.has(resolvedType)) {
+                        // 防止 proto 错误,导致一直在递归 
+                        set.add(resolvedType)
+                        instenceProto[name] = this.generateProtoInstence(resolvedType.name)
+                    }
+                }
+            });
             return instenceProto;
         }
         console.error('没有找到protoBufer相关数据');

+ 140 - 100
src/views/business/plan/components/audit/index.vue

@@ -12,123 +12,163 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">确认停用</a-button>
+                @click="pass">审核通过</a-button>
+        <a-button key="submit"
+                  type="primary"
+                  :loading="loading"
+                  @click="refuse">审核拒绝</a-button>
     </template>
-    <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="客户类型">
-            <span class="white">企业</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="企业名称">
-            <span class="white">深圳市前海矿业有限公司</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="企业简称">
-            <span class="white">前海矿业</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="证件类型">
-            <span class="white">营业执照</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="法定代表人">
-            <span class="white">李顺利</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="证件号码">
-            <span class="white">4328648236492432</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="纳税人识别号">
-            <span class="white">57465736DR46456</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="营业执照">
-            <a class="blue">查看附件</a>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="联系人">
-            <span class="white">王平</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="联系人手机号">
-            <span class="white">13745653421</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="联系电话">
-            <span class="white">0755-34342544</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="状态">
-            <span class="green">正常</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="通讯地址">
-            <span class="white">广东省深圳市南山区前海街道路平路1324号</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="备注">
-            <span class="white">无</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
+      <fieldset class="formFieldSet">
+          <legend>基本信息</legend>
+          <a-form class="inlineForm"
+                  :form="form"
+                  @submit="handleSearch">
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="计划类型">
+                          <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="计划名称">
+                          <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="现货品种">
+                          <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="标仓系数">
+                          <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="计划量">
+                          <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="备注">
+                          <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
+      <fieldset class="formFieldSet">
+          <legend>其它信息</legend>
+          <a-row :gutter="24">
+              <a-col :span="12">
+                  <a-form-item label="交易用户">
+                      <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
+                  </a-form-item>
+              </a-col>
+              <a-col :span="12">
+                  <a-form-item label="结算币种">
+                      <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
+                  </a-form-item>
+              </a-col>
+          </a-row>
+          <a-row :gutter="24">
+              <a-col :span="12">
+                  <a-form-item label="备注">
+                      <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                  </a-form-item>
+              </a-col>
+          </a-row>
+      </fieldset>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {Modal} from "ant-design-vue";
+import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
+import Long from "long";
+import {changeStatus} from "@/views/business/plan/components/setup";
+import {Ermcp3HedgePlan} from "@/services/go/ermcp/plan/interface";
+import {getPlanContractType} from "@/views/business/plan/setup";
+import {formatValue} from "@/common/methods";
 
 export default defineComponent({
     name: 'plan_audit_audit',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3HedgePlan>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('plan_audit_audit');
         const loading = ref<boolean>(false);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+        // 审核通过
+        function pass() {
+            Modal.confirm({
+                title: '是否确认审核通过',
+                okText: '审核通过',
+                cancelText: '取消',
+                onOk() {
+                    const params: ErmcpHedgePlanReq = {
+                        HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
+                        OperateType: 4,
+                        Remark: '通过'
+                    }
+                    changeStatus(params, 4, loading)
+                        .then(res => {
+                            cancel()
+                            context.emit('refresh')
+                        })
+                        .catch(err => {
+
+                        })
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
+        }
+        // 审核拒绝
+        function refuse(){
+            Modal.confirm({
+                title: '是否确认审核拒绝',
+                okText: '审核拒绝',
+                cancelText: '取消',
+                onOk() {
+                    const params: ErmcpHedgePlanReq = {
+                        HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
+                        OperateType: 5,
+                    }
+                    changeStatus(params, 5, loading)
+                        .then(res => {
+                            cancel()
+                            context.emit('refresh')
+                        })
+                        .catch(err => {
+
+                        })
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,
             cancel,
-            submit,
+            refuse,
             loading,
+            pass,
+            getPlanContractType,
+            formatValue,
+
         };
     },
 });

+ 129 - 30
src/views/business/plan/components/cancel/index.vue

@@ -1,49 +1,148 @@
 <template>
-  <!-- 计划撤销-->
-  <a-modal class="custom-detail"
-           title="计划撤销"
-           v-model:visible="visible"
-           centered
-           :maskClosable="maskClosableFlag"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                class="cancelBtn"
-                @click="cancel">取消</a-button>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">确认撤销</a-button>
-    </template>
-    plan_audit_cancel
-  </a-modal>
+    <!-- 计划撤销-->
+    <a-modal class="custom-detail"
+             title="计划撤销"
+             v-model:visible="visible"
+             centered
+             :maskClosable="maskClosableFlag"
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      class="cancelBtn"
+                      @click="cancel">取消
+            </a-button>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">确认撤销
+            </a-button>
+        </template>
+        <fieldset class="formFieldSet">
+            <legend>基本信息</legend>
+            <a-form class="inlineForm"
+                    :form="form"
+                    @submit="handleSearch">
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="计划类型">
+                            <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="计划名称">
+                            <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="现货品种">
+                            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="标仓系数">
+                            <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="计划量">
+                            <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="备注">
+                            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </fieldset>
+        <fieldset class="formFieldSet">
+            <legend>其它信息</legend>
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="交易用户">
+                        <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="结算币种">
+                        <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="备注">
+                        <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+        </fieldset>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import {defineComponent, PropType, ref} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {Ermcp3HedgePlan} from "@/services/go/ermcp/plan/interface";
+import {formatValue} from "@/common/methods";
+import {getPlanContractType} from "@/views/business/plan/setup";
+import {Modal} from "ant-design-vue";
+import {cancelPlan} from "@/views/business/plan/components/setup";
+import {HedgePlanOperateReq} from "@/services/proto/hedgeplan/interface";
+import * as Long from "long";
 
 export default defineComponent({
     name: 'plan_audit_cancel',
     components: {},
-    setup() {
-        const { visible, cancel } = closeModal('plan_audit_cancel');
-        const loading = ref<boolean>(false);
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3HedgePlan>,
+            default: {},
+        },
+    },
+    setup(props, context) {
+        const {visible, cancel} = closeModal('plan_audit_cancel');
         const maskClosableFlag = ref<boolean>(false);
+        const loading = ref<boolean>(false);
+
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            Modal.confirm({
+                title: '是否确认撤销',
+                okText: '确认撤销',
+                cancelText: '取消',
+                onOk() {
+                    const params: HedgePlanOperateReq = {
+                        HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
+                        OperateType: 5,
+                    }
+                    cancelPlan(params,  loading)
+                        .then(res => {
+                            cancel()
+                            context.emit('refresh')
+                        })
+                        .catch(err =>{
+                            
+                        })
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
+
         return {
             visible,
             cancel,
             submit,
-            loading,
             maskClosableFlag,
+            formatValue,
+            getPlanContractType,
         };
     },
 });

+ 104 - 8
src/views/business/plan/components/delete/index.vue

@@ -11,31 +11,127 @@
                 :loading="loading"
                 @click="submit">完成</a-button>
     </template>
+      <fieldset class="formFieldSet">
+          <legend>基本信息</legend>
+          <a-form class="inlineForm"
+                  :form="form"
+                  @submit="handleSearch">
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="计划类型">
+                          <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="计划名称">
+                          <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="现货品种">
+                          <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="标仓系数">
+                          <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="计划量">
+                          <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="备注">
+                          <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
+      <fieldset class="formFieldSet">
+          <legend>其它信息</legend>
+          <a-row :gutter="24">
+              <a-col :span="12">
+                  <a-form-item label="交易用户">
+                      <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
+                  </a-form-item>
+              </a-col>
+              <a-col :span="12">
+                  <a-form-item label="结算币种">
+                      <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
+                  </a-form-item>
+              </a-col>
+          </a-row>
+          <a-row :gutter="24">
+              <a-col :span="12">
+                  <a-form-item label="备注">
+                      <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                  </a-form-item>
+              </a-col>
+          </a-row>
+      </fieldset>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {Ermcp3HedgePlan} from "@/services/go/ermcp/plan/interface";
+import {formatValue} from "@/common/methods";
+import {getPlanContractType} from "@/views/business/plan/setup";
+import {Modal} from "ant-design-vue";
+import {changeStatus} from "@/views/business/plan/components/setup";
+import {ErmcpHedgePlanReq, HedgePlanOperateReq} from "@/services/proto/hedgeplan/interface";
+import * as Long from "long";
 
 export default defineComponent({
     name: 'plan_uncommitted_delete',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3HedgePlan>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('plan_uncommitted_delete');
         const loading = ref<boolean>(false);
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            Modal.confirm({
+                title: '是否确认删除',
+                okText: '确认删除',
+                cancelText: '取消',
+                onOk() {
+                    const params: ErmcpHedgePlanReq = {
+                        HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
+                        OperateType: 3,
+                    }
+                    changeStatus(params, 3, loading)
+                        .then(res => {
+                            cancel()
+                            context.emit('refresh')
+                        })
+                        .catch(err => {
+
+                        })
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,
             cancel,
             submit,
-            loading,
+            formatValue,
+            getPlanContractType,
         };
     },
 });

+ 94 - 70
src/views/business/plan/components/detail/index.vue

@@ -1,68 +1,95 @@
 <template>
-  <!-- 套保计划详情-->
-  <a-modal class="add-custom custom-detail"
-           title="套保计划详情"
-           v-model:visible="visible"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">关闭</a-button>
-    </template>
-    <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="计划类型">
-            <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="计划名称">
-            <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="现货品种">
-            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="标仓系数">
-            <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="计划量">
-            <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="备注">
-            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
-  </a-modal>
+    <!-- 套保计划详情-->
+    <a-modal class="add-custom custom-detail"
+             title="套保计划详情"
+             v-model:visible="visible"
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">关闭
+            </a-button>
+        </template>
+        <fieldset class="formFieldSet">
+            <legend>基本信息</legend>
+            <a-form class="inlineForm"
+                    :form="form"
+                    @submit="handleSearch">
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="计划类型">
+                            <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="计划名称">
+                            <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="现货品种">
+                            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="标仓系数">
+                            <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="计划量">
+                            <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="备注">
+                            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </fieldset>
+        <fieldset class="formFieldSet">
+            <legend>其它信息</legend>
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="交易用户">
+                        <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="结算币种">
+                        <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="备注">
+                        <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+        </fieldset>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, reactive, ref, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-import { mergeObj } from '@/utils/objHandle';
-import { getStatusName } from '@/views/information/custom/setup';
-import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
-import { formatValue } from '@/common/methods';
-import { getPlanContractType } from '@/views/business/plan/setup';
+import {defineComponent, PropType, reactive, ref, watchEffect} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {QueryCustomInfoType} from '@/services/go/ermcp/customInfo/interface';
+import {mergeObj} from '@/utils/objHandle';
+import {getStatusName} from '@/views/information/custom/setup';
+import {Ermcp3HedgePlan} from '@/services/go/ermcp/plan/interface';
+import {formatValue} from '@/common/methods';
+import {getPlanContractType} from '@/views/business/plan/setup';
+import {Modal} from "ant-design-vue";
 
 export default defineComponent({
     name: 'plan-detail',
@@ -73,21 +100,18 @@ export default defineComponent({
             default: {},
         },
     },
-    setup() {
-        const { visible, cancel } = closeModal('detail');
-        const loading = ref<boolean>(false);
+    setup(props, context) {
+        const {visible, cancel} = closeModal('detail');
+
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            context.emit('refresh')
+            cancel()
         }
+
         return {
             visible,
             cancel,
             submit,
-            loading,
             formatValue,
             getPlanContractType,
         };

+ 29 - 0
src/views/business/plan/components/setup.ts

@@ -0,0 +1,29 @@
+import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
+import { hedgePlanReq, oldHedgePlanReq } from "@/services/proto/hedgeplan";
+import { ErmcpHedgePlanReq, HedgePlanOperateReq } from "@/services/proto/hedgeplan/interface";
+import { deletePlanSign, hedgePlanSign } from "@/views/business/plan/setup";
+import { Ref } from "vue";
+
+
+/**
+ * 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
+ * @param id HedgePlanID
+ * @param type
+ */
+export function changeStatus(req: ErmcpHedgePlanReq, type: number, loading: Ref<boolean>): Promise<string> {
+    const sign = getRequestResultInfo(hedgePlanSign, type)  // 接口请求后的返回提示 这里统一进行管理
+    const result = hedgePlanReq(req)
+    return commonResultInfo(result, sign, loading)
+}
+
+/**
+ * 撤销套保计划
+ * @param req 撤销套保计划请求
+ * @param loading
+ */
+export function cancelPlan(req: HedgePlanOperateReq, loading: Ref<boolean>): Promise<string> {
+    const sign = getRequestResultInfo(deletePlanSign, 5)  // 接口请求后的返回提示 这里统一进行管理
+    const result = oldHedgePlanReq(req)
+    return commonResultInfo(result, sign, loading)
+}
+

+ 61 - 40
src/views/business/plan/list/audit/index.vue

@@ -1,43 +1,59 @@
 <template>
-  <!-- 计划: 审核中-->
-  <div class="plan_uncommitted"
-       :loading="loading">
-    <Filter @search="search">
-      <BtnList :btnList="commonBtn" />
-    </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #warehousetype="{ text }">
-          <span>{{ getWareHouseType(text) }}</span>
-        </template>
-        <template #warehousestatus="{ text }">
-          <span>{{ getWareHouseStatus(text) }}</span>
-        </template> -->
-      </a-table>
-    </contextMenu>
-    <!-- 详情 -->
-    <Detail />
-    <!-- 撤销 -->
-    <Cancel />
-    <!-- 审核 -->
-    <Audit />
-  </div>
+    <!-- 计划: 审核中-->
+    <div class="plan_uncommitted"
+         :loading="loading">
+        <Filter @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </Filter>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+
+                <template #contracttype="{ text }">
+                    <a>{{ getPlanContractType(text) }}</a>
+                </template>
+                <template #hedgeplanstatus="{ text }">
+                    <a>{{ getPlanStatusName(text) }}</a>
+                </template>
+                <!-- <template #warehousetype="{ text }">
+                  <span>{{ getWareHouseType(text) }}</span>
+                </template>
+                <template #warehousestatus="{ text }">
+                  <span>{{ getWareHouseStatus(text) }}</span>
+                </template> -->
+            </a-table>
+        </contextMenu>
+        <!-- 详情 -->
+        <Detail :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 撤销 -->
+        <Cancel :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 审核 -->
+        <Audit :selectedRow="selectedRow" @refresh="queryTable"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
-import { Add, Detail, Filter, Recommit, Cancel, Audit } from '../../components';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
+import {getFilterTableCB, queryTableList, Ermcp3HedgePlan} from '../index';
+import {Add, Detail, Filter, Recommit, Cancel, Audit} from '../../components';
+import {getPlanContractType, getPlanStatusName} from "@/views/business/plan/setup";
 
 export default defineComponent({
     name: 'plan_uncommitted',
@@ -53,19 +69,21 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<Ermcp3HedgePlan>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('plan_audit', true);
+        const {commonBtn, forDataBtn} = getBtnList('plan_audit', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList('1');
+        const {loading, tableList, queryTable} = queryTableList('1,4');
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         initData(() => {
             // 获取列表数据
             queryTable();
@@ -83,6 +101,9 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getPlanStatusName,
+            getPlanContractType,
+            queryTable,
         };
     },
 });

+ 60 - 40
src/views/business/plan/list/running/index.vue

@@ -1,43 +1,58 @@
 <template>
-  <!-- 计划: 执行中-->
-  <div class="plan_running"
-       :loading="loading">
-    <Filter @search="search">
-      <BtnList :btnList="commonBtn" />
-    </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #warehousetype="{ text }">
-          <span>{{ getWareHouseType(text) }}</span>
-        </template>
-        <template #warehousestatus="{ text }">
-          <span>{{ getWareHouseStatus(text) }}</span>
-        </template> -->
-      </a-table>
-    </contextMenu>
-    <!-- 详情 -->
-    <Detail />
-    <!-- 撤销 -->
-    <Cancel />
-    <!-- 审核 -->
-    <Audit />
-  </div>
+    <!-- 计划: 执行中-->
+    <div class="plan_running"
+         :loading="loading">
+        <Filter @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </Filter>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <template #contracttype="{ text }">
+                    <a>{{ getPlanContractType(text) }}</a>
+                </template>
+                <template #hedgeplanstatus="{ text }">
+                    <a>{{ getPlanStatusName(text) }}</a>
+                </template>
+                <!-- <template #warehousetype="{ text }">
+                  <span>{{ getWareHouseType(text) }}</span>
+                </template>
+                <template #warehousestatus="{ text }">
+                  <span>{{ getWareHouseStatus(text) }}</span>
+                </template> -->
+            </a-table>
+        </contextMenu>
+        <!-- 详情 -->
+        <Detail :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 撤销 -->
+        <Cancel :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 审核 -->
+        <Audit :selectedRow="selectedRow" @refresh="queryTable"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
-import { Add, Detail, Filter, Recommit } from '../../components';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
+import {getFilterTableCB, queryTableList, Ermcp3HedgePlan} from '../index';
+import {Add, Detail, Filter, Recommit} from '../../components';
+import {getPlanContractType, getPlanStatusName} from "@/views/business/plan/setup";
 
 export default defineComponent({
     name: 'spot-contract-peddding',
@@ -51,19 +66,21 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<Ermcp3HedgePlan>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('plan_running', true);
+        const {commonBtn, forDataBtn} = getBtnList('plan_running', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList('2');
+        const {loading, tableList, queryTable} = queryTableList('2');
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         initData(() => {
             // 获取列表数据
             queryTable();
@@ -81,6 +98,9 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getPlanStatusName,
+            getPlanContractType,
+            queryTable,
         };
     },
 });

+ 64 - 44
src/views/business/plan/list/uncommitted/index.vue

@@ -1,47 +1,62 @@
 <template>
-  <!-- 计划: 未提交-->
-  <div class="plan-uncommitted"
-       :loading="loading">
-    <Filter @search="search">
-      <BtnList :btnList="commonBtn" />
-    </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #warehousetype="{ text }">
-          <span>{{ getWareHouseType(text) }}</span>
-        </template>
-        <template #warehousestatus="{ text }">
-          <span>{{ getWareHouseStatus(text) }}</span>
-        </template> -->
-      </a-table>
-    </contextMenu>
-    <!-- 详情 -->
-    <Detail />
-    <!-- 新增 -->
-    <Add />
-    <!-- 修改 -->
-    <Modfiy />
-    <!-- 重新提交 -->
-    <Recommit />
-    <!-- 删除-->
-    <Delete />
-  </div>
+    <!-- 计划: 未提交-->
+    <div class="plan-uncommitted"
+         :loading="loading">
+        <Filter @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </Filter>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <template #contracttype="{ text }">
+                    <a>{{ getPlanContractType(text) }}</a>
+                </template>
+                <template #hedgeplanstatus="{ text }">
+                    <a>{{ getPlanStatusName(text) }}</a>
+                </template>
+                <!-- <template #warehousetype="{ text }">
+                  <span>{{ getWareHouseType(text) }}</span>
+                </template>
+                <template #warehousestatus="{ text }">
+                  <span>{{ getWareHouseStatus(text) }}</span>
+                </template> -->
+            </a-table>
+        </contextMenu>
+        <!-- 详情 -->
+        <Detail :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 新增 -->
+        <Add :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 修改 -->
+        <Modfiy :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 重新提交 -->
+        <Recommit :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 删除-->
+        <Delete :selectedRow="selectedRow" @refresh="queryTable"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
-import { Add, Delete, Detail, Filter, Modfiy, Recommit } from '../../components';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
+import {getFilterTableCB, queryTableList, Ermcp3HedgePlan} from '../index';
+import {Add, Delete, Detail, Filter, Modfiy, Recommit} from '../../components';
+import {getPlanContractType, getPlanStatusName} from "@/views/business/plan/setup";
 
 export default defineComponent({
     name: 'plan-uncommitted',
@@ -57,19 +72,21 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<Ermcp3HedgePlan>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('plan_uncommitted', true);
+        const {commonBtn, forDataBtn} = getBtnList('plan_uncommitted', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList('0');
+        const {loading, tableList, queryTable} = queryTableList('0,6');
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         initData(() => {
             // 获取列表数据
             queryTable();
@@ -87,6 +104,9 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getPlanStatusName,
+            getPlanContractType,
+            queryTable,
         };
     },
 });

+ 52 - 1
src/views/business/plan/setup.ts

@@ -1,3 +1,5 @@
+import {ResultInfo} from "@/common/methods/request/interface";
+
 /**
  * 计划类型 - 1:采购 -1:销售
  * @param contracttype 返回计划类型
@@ -13,4 +15,53 @@ export function getPlanContractType(contracttype: number): string{
             break
     }
     return result
-}
+}
+
+/**
+ * 获取计划状态名称
+ * @param hedgeplanstatus //0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+ */
+export function getPlanStatusName(hedgeplanstatus: number): string{
+    let result = "--";
+    switch (hedgeplanstatus) {
+        case 0:
+            result = "未提交";
+            break
+        case 1:
+            result = "待审核";
+            break
+        case 2:
+            result = "执行中";
+            break
+        case 3:
+            result = "正常完结";
+            break
+        case 4:
+            result = "审核拒绝";
+            break
+        case 5:
+            result = "异常完结";
+            break
+        case 6:
+            result = "已撤回";
+            break
+    }
+    return result
+}
+
+/************** 接口相关提示 **************** /
+ *
+ */
+// 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
+export const hedgePlanSign = new Map<number, ResultInfo>([
+    [1, ['保存草稿成功', '保存草稿失败:']],
+    [2, ['提交申请成功', '提交申请失败:']],
+    [3, ['删除成功', '删除失败:']],
+    [4, ['审核通过', '审核失败:']],
+    [5, ['审核拒绝成功', '审核拒绝失败:']],
+
+])
+
+export const deletePlanSign = new Map<number, ResultInfo>([
+    [5, ['撤销成功', '撤销失败:']],
+])

+ 51 - 52
src/views/information/spot-contract/components/add/index.vue

@@ -337,23 +337,26 @@
         <legend>其他信息</legend>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="保证金">
+            <a-form-item label="保证金"
+                         name="ContractMargin">
               <a-input class="dialogInput suffixGrey"
                        placeholder="请输入保证金"
+                       v-model:value="formState.ContractMargin"
                        style="width: 200px"
                        :suffix="payCurrencyUnit" />
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="业务员">
+            <a-form-item label="业务员"
+                         name="SaleUserID">
               <a-select class="inlineFormSelect"
+                        v-model:value="formState.SaleUserID"
                         style="width: 200px"
                         placeholder="请选择业务员">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in businesserList"
+                                 :key="item.id"
+                                 :value="item.id">
+                  {{item.name}}
                 </a-select-option>
               </a-select>
             </a-form-item>
@@ -361,29 +364,31 @@
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="跟单员">
+            <a-form-item label="跟单员"
+                         name="MerUserID">
               <a-select class="inlineFormSelect"
+                        v-model:value="formState.MerUserID"
                         style="width: 200px"
                         placeholder="请选择跟单员">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in merchandiserList"
+                                 :key="item.id"
+                                 :value="item.id">
+                  {{item.name}}
                 </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="期货账户">
+            <a-form-item label="交易用户"
+                         name="TradeUserID">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        v-model:value="formState.TradeUserID"
                         placeholder="请选择期货账户">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in traderList"
+                                 :key="item.id"
+                                 :value="item.id">
+                  {{item.name}}
                 </a-select-option>
               </a-select>
             </a-form-item>
@@ -404,17 +409,19 @@
 </template>
 
 <script lang="ts">
-import {defineComponent, PropType, ref, toRaw} from 'vue';
+import { defineComponent, PropType, ref, toRaw } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods';
-import { handleFromState, handleContract, handlevalidate, handleDeliveryGoods, handleAmout, handlePrice, handleDate, addContractReq } from './setup';
+import { handleFromState, handleContract, handleDeliveryGoods, handleAmout, handlePrice, handleDate, addContractReq } from './setup';
 import { getUserName, getUsrId } from '@/services/bus/user';
 import { getGoodsList } from '@/services/bus/goods';
 import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { FormState } from './interface';
 import { formatTime } from '@/common/methods/format';
-import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
+import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+import { handleAccountManager } from '../setup';
+import { Moment } from 'moment';
 
 export default defineComponent({
     name: 'add-spot-contract',
@@ -425,35 +432,17 @@ export default defineComponent({
             default: {},
         },
     },
-    setup(props,context) {
+    setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_add');
-        const { loading, sendReq } = addContractReq();
+        const { sendReq } = addContractReq();
+        const loading = ref<boolean>(false);
 
         // 表单
         const formRef = ref();
-        const { formState, businessType } = handleFromState();
+        const { formState, businessType, rules } = handleFromState();
         // 合同类型
         const { contractType, isSell, contractChange, customList, queryCustomList } = handleContract();
-        // 自定义表单验证方法
-        const { v_ContractType, v_BizType, v_BuyUser, v_SellUser, v_DeliveryGoods, v_WrStandard, v_SpotGoodsBrand, v_PriceType, v_Currency, v_Goods } = handlevalidate(formState);
-        const rules = {
-            ContractNo: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
-            ContractType: [{ required: true, validator: v_ContractType, trigger: 'change' }],
-            // BizType: [{ required: true, validator: v_BizType, trigger: 'change' }],
-            BuyUserID: [{ required: true, validator: v_BuyUser, trigger: 'change' }],
-            SellUserID: [{ required: true, validator: v_SellUser, trigger: 'change' }],
-            DeliveryGoodsID: [{ required: true, validator: v_DeliveryGoods, trigger: 'change' }],
-            WrStandardID: [{ required: true, validator: v_WrStandard, trigger: 'blur' }],
-            SpotGoodsBrandID: [{ required: true, validator: v_SpotGoodsBrand, trigger: 'blur' }],
-            GoodsID: [{ required: true, validator: v_Goods, trigger: 'blur' }],
-            // ConvertFactor: [{ required: true, message: '请选择品类', trigger: 'blur' }],
-            SpotGoodsDesc: [{ required: true, message: '请输入商品规格', trigger: 'blur' }],
-            PriceType: [{ required: true, validator: v_PriceType, trigger: 'blur' }],
-            CurrencyID: [{ required: true, validator: v_Currency, trigger: 'blur' }],
-            Qty: [{ required: true, message: '请输入数量', trigger: 'blur' }],
-            Price: [{ required: true, message: '请输入价格', trigger: 'blur' }],
-            PriceMove: [{ required: true, message: '请输入升贴水', trigger: 'blur' }],
-        };
+
         //  处理现货商品
         const { deliveryGoodsList, gblist, gmlist, numberUnit, WrStandardChange, getDeliveryGoods, deliveryGoodsChange } = handleDeliveryGoods(formState);
         // 价格信息
@@ -462,21 +451,26 @@ export default defineComponent({
         const { deliveryDate, priceDate, disabledDate } = handleDate();
         // 处理金额
         const { getAmout } = handleAmout(formState);
+        // 账号列表: 交易用户 业务员 跟单员
+        const { traderList, businesserList, merchandiserList, getRoleList, getBusinesserList } = handleAccountManager();
         // 现货商品列表
         const goodsList = ref<Goods[]>([]);
-        function submit(OperateType: number) {
+
+        function submit(OperateType: 1 | 2) {
             formRef.value
                 .validate()
                 .then(() => {
                     const param = toRaw(formState);
                     const id = getUsrId();
                     isSell.value ? (param.SellUserID = id) : (param.BuyUserID = id);
-
+                    const fn = (value: Moment) => {
+                        return formatTime(value, 'd') + ' ' + '00:00:00';
+                    };
                     // 交收期
                     const dDate = deliveryDate.value;
                     if (dDate.length) {
-                        const DeliveryStartDate = formatTime(dDate[0], 'd') + '00:00:00';
-                        const DeliveryEndDate = formatTime(dDate[1], 'd') + '00:00:00';
+                        const DeliveryStartDate = fn(dDate[0]);
+                        const DeliveryEndDate = fn(dDate[1]);
                         Object.assign(param, { DeliveryStartDate, DeliveryEndDate });
                     }
 
@@ -484,13 +478,13 @@ export default defineComponent({
                     const pDate = priceDate.value;
                     if (pDate.length && param.PriceType !== 1) {
                         // 点价日期[2:点价3:暂定价]
-                        const StartDate = formatTime(dDate[0], 'd') + '00:00:00';
-                        const EndDate = formatTime(dDate[1], 'd') + '00:00:00';
+                        const StartDate = fn(pDate[0]);
+                        const EndDate = fn(pDate[1]);
                         Object.assign(param, { StartDate, EndDate });
                     }
                     console.log('values', formState);
 
-                    sendReq(param, OperateType)
+                    sendReq(param, loading, OperateType)
                         .then((res) => {
                             context.emit('refresh');
                             cancel();
@@ -505,6 +499,8 @@ export default defineComponent({
             queryCustomList();
             getDeliveryGoods();
             goodsList.value = getGoodsList();
+            getRoleList();
+            getBusinesserList();
         });
         return {
             visible,
@@ -536,6 +532,9 @@ export default defineComponent({
             disabledDate,
             goodsList,
             getAmout,
+            traderList,
+            businesserList,
+            merchandiserList,
         };
     },
 });

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

@@ -26,7 +26,7 @@ export interface FormState {
     // PointDesc: string // string 点价备注[2:点价3:暂定价]
     // DeliveryDesc: string  // string 交收方式
     MerUserID: number | undefined // uint64 跟单员ID
-    TradeUserID: number // uint64 交易员ID
+    TradeUserID: number | undefined// uint64 交易员ID
     // PricedQty: number // double 已定价量
     // PricedAmount: number // double 已定价金额
     SpotGoodsBrandID: number | undefined // uint64 现货品牌ID

+ 93 - 74
src/views/information/spot-contract/components/add/setup.ts

@@ -5,12 +5,15 @@ import { QueryCustomInfo } from '@/services/go/ermcp/customInfo';
 import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { QueryDeliveryGoods, QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
 import { Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsRsp } from '@/services/go/ermcp/goodsInfo/interface';
-import { GldSpotContractInfo } from "@/services/proto/spotcontract/interface";
-import { changeOrderContract } from "@/views/information/spot-contract/components/setup";
+import {
+    GldErmcpSpotContractOperateReq,
+    GldSpotContractInfo
+} from "@/services/proto/spotcontract/interface";
+import { orderContractControl } from "@/views/information/spot-contract/components/setup";
 import { message } from 'ant-design-vue';
 import { RuleObject } from 'ant-design-vue/lib/form/interface';
 import moment, { Moment } from 'moment';
-import { reactive, ref, UnwrapRef } from 'vue';
+import { reactive, Ref, ref, UnwrapRef } from 'vue';
 import { FormState } from "./interface";
 
 export function handleFromState() {
@@ -42,26 +45,95 @@ export function handleFromState() {
         PriceMove: null,// double 升贴水[2:点价3:暂定价]
         StartDate: '', //                       点价开始时间
         EndDate: '', //                           点价结束时间
-        TradeUserID: 0, //           交易员ID
+        TradeUserID: undefined, //           交易员ID
     })
     // 业务类型
     const businessType = [
         { key: 1, value: '套保' },
         { key: 2, value: '套利' },
     ];
-    return { formState, businessType }
+    // 验证合同类型
+    async function v_ContractType(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择合同类型')
+    }
+
+    // 验证业务类型
+    // async function v_BizType(rule: RuleObject, value: number) {
+    //     return validateCommon(value, '请选择业务类型')
+    // }
+
+    // 验证业务类型
+    async function v_BuyUser(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择采购方')
+    }
+
+    // 验证业务类型
+    async function v_SellUser(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择销售方')
+    }
+
+    // 验证现货品种
+    async function v_DeliveryGoods(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择现货品种')
+    }
+
+    // 验证品类
+    async function v_WrStandard(rule: RuleObject, value: number) {
+        const errorInfo = formState.DeliveryGoodsID ? '请选择品类' : '请先选择现货品种'
+        return validateCommon(value, errorInfo)
+    }
+
+    // 验证品牌
+    async function v_SpotGoodsBrand(rule: RuleObject, value: number) {
+        const errorInfo = formState.DeliveryGoodsID ? '请选择品牌' : '请先选择现货品种'
+        return validateCommon(value, errorInfo)
+    }
+
+    // 验证定价类型
+    async function v_PriceType(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择定价类型')
+    }
+
+    // 验证结算币种
+    async function v_Currency(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择结算币种')
+    }
+
+    // 验证点价合约
+    async function v_Goods(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择点价合约')
+    }
+    const rules = {
+        ContractNo: [{ required: true, message: '请输入合同编号', trigger: 'blur' }],
+        ContractType: [{ required: true, validator: v_ContractType, trigger: 'change' }],
+        // BizType: [{ required: true, validator: v_BizType, trigger: 'change' }],
+        BuyUserID: [{ required: true, validator: v_BuyUser, trigger: 'change' }],
+        SellUserID: [{ required: true, validator: v_SellUser, trigger: 'change' }],
+        DeliveryGoodsID: [{ required: true, validator: v_DeliveryGoods, trigger: 'change' }],
+        WrStandardID: [{ required: true, validator: v_WrStandard, trigger: 'blur' }],
+        SpotGoodsBrandID: [{ required: true, validator: v_SpotGoodsBrand, trigger: 'blur' }],
+        GoodsID: [{ required: true, validator: v_Goods, trigger: 'blur' }],
+        // ConvertFactor: [{ required: true, message: '请选择品类', trigger: 'blur' }],
+        SpotGoodsDesc: [{ required: true, message: '请输入商品规格', trigger: 'blur' }],
+        PriceType: [{ required: true, validator: v_PriceType, trigger: 'blur' }],
+        CurrencyID: [{ required: true, validator: v_Currency, trigger: 'blur' }],
+        Qty: [{ required: true, message: '请输入数量', trigger: 'blur' }],
+        Price: [{ required: true, message: '请输入价格', trigger: 'blur' }],
+        PriceMove: [{ required: true, message: '请输入升贴水', trigger: 'blur' }],
+    };
+    return { formState, businessType, rules }
 }
 
 /**
  * 新增现货合同 表单提交
  */
 export function addContractReq() {
-    const { loading, orderContractState } = changeOrderContract()
     /**
      * @param form 表单信息
      *  @Param type  1: 保存草稿  2: 提交申请
      */
-    function sendReq(form: FormState, type: number): Promise<string> {
+    function sendReq(form: FormState, loading: Ref<boolean>, OperateType: 1 | 2): Promise<string> {
+        loading.value = true
         const info: GldSpotContractInfo = {
             UserID: APP.get('userAccount').memberuserid,//  机构ID
             ProductType: 1, //                              产品类型 产品类型-1:标准仓单2:等标3:非标
@@ -85,7 +157,7 @@ export function addContractReq() {
             BizType: form.BizType, //                       业务类型 - 1:套保 2:套利
             Remark: form.Remark,  //       合同备注
             // ContractAttachment: ,  // 合同附件
-            ContractMargin: form.ContractMargin as number, //         合同保证金
+            ContractMargin: form.ContractMargin ? Number(form.ContractMargin) : 0, //         合同保证金
 
             Amount: [1, 3].includes(form.PriceType) ? Number(form.Price) * Number(form.Qty) : 0, //    金额
             PriceMove: Number(form.PriceMove as number), //  升贴水
@@ -97,11 +169,19 @@ export function addContractReq() {
 
             GoodsID: form.GoodsID as number, //               点价合约ID-0:为现货,其它为期货商品合约ID[2:点价3:暂定价]
 
-            // MerUserID: form.MerUserID, //             跟单员ID
-            // TradeUserID: form.TradeUserID, //           交易员ID
-            // SaleUserID: form.SaleUserID,//             业务员id
+            MerUserID: form.MerUserID || 0, //             跟单员ID
+            TradeUserID: form.TradeUserID || 0, //           交易员ID
+            SaleUserID: form.SaleUserID || 0,//             业务员id
+        }
+        const params: GldErmcpSpotContractOperateReq = {
+            SpotContractID: '0',
+            OperateType,
+            Remark: '',
+            Info: info,
         }
-        return orderContractState('0', type, info)
+        console.log('prams', params);
+
+        return orderContractControl(params, loading)
             .then(res => {
                 return Promise.resolve(res);
             })
@@ -110,7 +190,7 @@ export function addContractReq() {
             })
     }
 
-    return { loading, sendReq }
+    return { sendReq }
 }
 
 /**
@@ -146,67 +226,6 @@ export function handleContract() {
     return { contractType, isSell, contractChange, customList, queryCustomList }
 }
 
-/**
- * 自定义表单验证方法
- */
-export function handlevalidate(formState: UnwrapRef<FormState>) {
-    // 验证合同类型
-    async function v_ContractType(rule: RuleObject, value: number) {
-        return validateCommon(value, '请选择合同类型')
-    }
-
-    // 验证业务类型
-    async function v_BizType(rule: RuleObject, value: number) {
-        return validateCommon(value, '请选择业务类型')
-    }
-
-    // 验证业务类型
-    async function v_BuyUser(rule: RuleObject, value: number) {
-        return validateCommon(value, '请选择采购方')
-    }
-
-    // 验证业务类型
-    async function v_SellUser(rule: RuleObject, value: number) {
-        return validateCommon(value, '请选择销售方')
-    }
-
-    // 验证现货品种
-    async function v_DeliveryGoods(rule: RuleObject, value: number) {
-        return validateCommon(value, '请选择现货品种')
-    }
-
-    // 验证品类
-    async function v_WrStandard(rule: RuleObject, value: number) {
-        const errorInfo = formState.DeliveryGoodsID ? '请选择品类' : '请先选择现货品种'
-        return validateCommon(value, errorInfo)
-    }
-
-    // 验证品牌
-    async function v_SpotGoodsBrand(rule: RuleObject, value: number) {
-        const errorInfo = formState.DeliveryGoodsID ? '请选择品牌' : '请先选择现货品种'
-        return validateCommon(value, errorInfo)
-    }
-
-    // 验证定价类型
-    async function v_PriceType(rule: RuleObject, value: number) {
-        return validateCommon(value, '请选择定价类型')
-    }
-
-    // 验证结算币种
-    async function v_Currency(rule: RuleObject, value: number) {
-        return validateCommon(value, '请选择结算币种')
-    }
-
-    // 验证点价合约
-    async function v_Goods(rule: RuleObject, value: number) {
-        return validateCommon(value, '请选择点价合约')
-    }
-
-    return {
-        v_ContractType, v_BizType, v_BuyUser, v_SellUser, v_DeliveryGoods, v_WrStandard,
-        v_SpotGoodsBrand, v_PriceType, v_Currency, v_Goods
-    }
-}
 
 /**
  * 处理现货商品

+ 10 - 3
src/views/information/spot-contract/components/cancel/index.vue

@@ -188,7 +188,9 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {message, Modal} from "ant-design-vue";
-import { OrderContractControl} from "@/views/information/spot-contract/components/setup";
+import { orderContractOperateControl } from "@/views/information/spot-contract/components/setup";
+import {SpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import Long from "long";
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -201,7 +203,7 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_cancel');
-        const {loading, orderContractState} = OrderContractControl()
+        const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             Modal.confirm({
@@ -209,8 +211,13 @@ export default defineComponent({
                 okText: '确认撤销',
                 cancelText: '取消',
                 onOk() {
+                    const params : SpotContractOperateReq = {
+                        SpotContractID: Long.fromString(props.selectedRow.spotcontractid),
+                        OperateType: 5,
+                        Remark: '',
+                    }
                     // 撤销合同
-                    orderContractState(props.selectedRow.spotcontractid, 5)
+                    orderContractOperateControl(params, loading)
                         .then(res => {
                             // 通知上层  刷新数据
                             context.emit('refresh');

+ 100 - 71
src/views/information/spot-contract/components/check/index.vue

@@ -7,16 +7,19 @@
            :maskClosable="maskClosableFlag"
            @cancel="cancel"
            width="890px">
-     <template #footer>
-       <a-button key="submit"
+    <template #footer>
+      <a-button key="submit"
                 class="cancelBtn"
                 @click="refuse">审核拒绝</a-button>
-        <a-button key="submit"
+      <a-button key="submit"
                 type="primary"
                 :loading="loading"
                 @click="submit">审核通过</a-button>
     </template>
-    <a-form class="inlineForm">
+    <a-form class="inlineForm"
+            ref="formRef"
+            :model="formState"
+            :rules="rules">
       <fieldset class="formFieldSet">
         <legend>基本信息</legend>
         <a-row :gutter="24">
@@ -39,28 +42,28 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="采购方">
-                <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
+              <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
             </a-form-item>
           </a-col>
-      </a-row>
-      <a-row :gutter="24">
+        </a-row>
+        <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="销售方">
-             <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+              <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同附件">
-                <div class="upload">
-                    <div class="look">{{ formatValue(selectedRow.contracctstatus) }}</div>
-                </div>
+              <div class="upload">
+                <div class="look">{{ formatValue(selectedRow.contracctstatus) }}</div>
+              </div>
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="状态">
-             <span class="green">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</span>
+              <span class="green">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -87,11 +90,11 @@
           </a-col>
           <a-col :span="12">
             <a-form-item label="标仓系数">
-                <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
+              <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
             </a-form-item>
           </a-col>
-      </a-row>
-      <a-row :gutter="24">
+        </a-row>
+        <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="商品规格">
               <span class="white">{{ formatValue(selectedRow.spotgoodsdesc) }}</span>
@@ -147,15 +150,16 @@
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="业务员">
+            <a-form-item label="业务员"
+                         name="SaleUserID">
               <a-select class="inlineFormSelect"
+                        v-model:value="formState.SaleUserID"
                         style="width: 200px"
                         placeholder="请选择业务员">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in businesserList"
+                                 :key="item.id"
+                                 :value="item.id">
+                  {{item.name}}
                 </a-select-option>
               </a-select>
             </a-form-item>
@@ -163,35 +167,37 @@
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="跟单员">
+            <a-form-item label="跟单员"
+                         name="MerUserID">
               <a-select class="inlineFormSelect"
+                        v-model:value="formState.MerUserID"
                         style="width: 200px"
                         placeholder="请选择跟单员">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in merchandiserList"
+                                 :key="item.id"
+                                 :value="item.id">
+                  {{item.name}}
                 </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="期货账户">
-                <a-select class="inlineFormSelect"
+            <a-form-item label="交易用户"
+                         name="TradeUserID">
+              <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        v-model:value="formState.TradeUserID"
                         placeholder="请选择期货账户">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in traderList"
+                                 :key="item.id"
+                                 :value="item.id">
+                  {{item.name}}
                 </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
-      </a-row>
-      <a-row :gutter="24">
+        </a-row>
+        <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="备注">
               <span class="white">{{ formatValue(selectedRow.remark) }}</span>
@@ -203,10 +209,12 @@
         <legend>审核信息</legend>
         <a-row :gutter="24">
           <a-col :span="24">
-            <a-form-item label="审核意见">
+            <a-form-item label="审核意见"
+                         name="Remark">
               <a-input class="dialogInput"
-                      style="width: 620px"
-                      placeholder="请输入审核意见" />
+                       v-model:value="formState.Remark"
+                       style="width: 620px"
+                       placeholder="请输入审核意见" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -216,18 +224,17 @@
 </template>
 
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
+import { defineComponent, PropType, ref, toRaw } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import {
-    getBizTypeName,
-    getContractStatusName,
-    getContractTypeName,
-    getPriceTypeName
-} from "@/views/information/spot-contract/setup";
-import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
-import {formatTime, formatValue} from "@/common/methods";
-import {changeOrderContract, OrderContractControl} from "@/views/information/spot-contract/components/setup";
-import {Modal} from "ant-design-vue";
+import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/views/information/spot-contract/setup';
+import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
+import { formatTime, formatValue, initData } from '@/common/methods';
+import { orderContractControl, orderContractOperateControl } from '@/views/information/spot-contract/components/setup';
+import { Modal } from 'ant-design-vue';
+import { handleForm } from './setup';
+import { handleAccountManager } from '../setup';
+import { GldErmcpSpotContractOperateReq, SpotContractOperateReq } from '@/services/proto/spotcontract/interface';
+import Long from 'long';
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -240,56 +247,71 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_check');
-        const  { loading, orderContractState } = changeOrderContract()
-        const maskClosableFlag = ref<boolean>(false);
+        // 账号列表: 交易用户 业务员 跟单员
+        const { traderList, businesserList, merchandiserList, getRoleList, getBusinesserList } = handleAccountManager();
+
+        const loading = ref<boolean>(false);
+        // 表单
+        const { rules, formState, formRef } = handleForm();
         function submit() {
             Modal.confirm({
                 title: '是否确认审核通过',
                 okText: '确认审核通过',
                 cancelText: '取消',
                 onOk() {
-                    // 审核通过
-                    orderContractState(props.selectedRow.spotcontractid, 4)
-                        .then(res => {
-                            cancel()
-                            context.emit('refresh')
-                        })
-                        .catch(err => {
+                    formRef.value.validate().then(() => {
+                        const param = toRaw(formState);
 
-                        })
+                        const reqs: GldErmcpSpotContractOperateReq = {
+                            SpotContractID: props.selectedRow.spotcontractid,
+                            OperateType: 4,
+                            Remark: param.Remark,
+                            Info: {BizType: props.selectedRow.biztype, CurrencyID: props.selectedRow.currencyid, ...param},
+                        };
+                        // 审核通过
+                        orderContractControl(reqs, loading).then(() => {
+                            cancel();
+                            context.emit('refresh');
+                        });
+                    });
                 },
                 onCancel() {
                     console.log('Cancel');
                 },
             });
         }
-        function refuse(){
+        function refuse() {
             Modal.confirm({
                 title: '是否确认审核拒绝',
                 okText: '确认审核拒绝',
                 cancelText: '取消',
                 onOk() {
+                    const param = toRaw(formState);
+                    const reqs: SpotContractOperateReq = {
+                        SpotContractID: props.selectedRow.spotcontractid,
+                        OperateType: 4,
+                        Remark: param.Remark,
+                    };
                     // 审核拒绝
-                    OrderContractControl().orderContractState(props.selectedRow.spotcontractid, 4)
-                        .then(res => {
-                            cancel()
-                            context.emit('refresh')
-                        })
-                        .catch(err => {
-
-                        })
+                    orderContractOperateControl(reqs, loading).then(() => {
+                        cancel();
+                        context.emit('refresh');
+                    });
                 },
                 onCancel() {
                     console.log('Cancel');
                 },
             });
         }
+        initData(() => {
+            getRoleList();
+            getBusinesserList();
+        });
         return {
             visible,
             cancel,
             submit,
-            loading,
-            maskClosableFlag,
+            maskClosableFlag: false,
             getContractTypeName,
             getBizTypeName,
             formatValue,
@@ -297,6 +319,13 @@ export default defineComponent({
             formatTime,
             getPriceTypeName,
             refuse,
+            traderList,
+            businesserList,
+            merchandiserList,
+            loading,
+            formState,
+            rules,
+            formRef,
         };
     },
 });

+ 11 - 0
src/views/information/spot-contract/components/check/interface.ts

@@ -0,0 +1,11 @@
+export interface Value {
+    id: number,
+    name: string,
+}
+
+export interface FormState {
+    MerUserID: number | undefined// uint64 跟单员ID
+    TradeUserID: number | undefined// uint64 交易员ID
+    SaleUserID: number | undefined // uint64 业务员ID
+    Remark: string
+}

+ 31 - 16
src/views/information/spot-contract/components/check/setup.ts

@@ -1,18 +1,33 @@
-// import {  QueryAccMgrLoginUser }  from '@/services/go/ermcp/account'
+import { validateCommon } from '@/common/setup/validate';
+import { RuleObject } from 'ant-design-vue/lib/form/interface';
+import { reactive, ref, UnwrapRef } from 'vue';
+import { FormState } from './interface';
 
-export function handleAccountManager() {
-    // function getList(arr) {
-    //     arr.forEach(el => {
-
-    //     });
-    // }
-    // QueryAccMgrLoginUser(1).then(res => {
-    //     const map = new Set<number>([])
-    //     res.forEach(e => {
-
-    //     })
-    //     if (res.length) {
-
-    //     }
-    // })
+// 表单
+export function handleForm() {
+    const formRef = ref();
+    const formState: UnwrapRef<FormState> = reactive({
+        MerUserID: undefined,// uint64 跟单员ID
+        TradeUserID: undefined,// uint64 交易员ID
+        SaleUserID: undefined, // uint64 业务员ID
+        Remark: ''
+    })
+    // 验证跟单员
+    async function v_MerUser(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择跟单员')
+    }
+    // 验证交易员
+    async function v_TradeUser(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择交易员')
+    }
+    // 验证业务员
+    async function v_SaleUser(rule: RuleObject, value: number) {
+        return validateCommon(value, '请选择业务员')
+    }
+    const rules = {
+        MerUserID: [{ required: true, validator: v_MerUser, trigger: 'blur' }],
+        TradeUserID: [{ required: true, validator: v_TradeUser, trigger: 'blur' }],
+        SaleUserID: [{ required: true, validator: v_SaleUser, trigger: 'blur' }],
+    }
+    return { rules, formState, formRef }
 }

+ 10 - 3
src/views/information/spot-contract/components/delete/index.vue

@@ -188,7 +188,9 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {message, Modal} from "ant-design-vue";
-import {changeOrderContract, OrderContractControl} from "@/views/information/spot-contract/components/setup";
+import {orderContractControl} from "@/views/information/spot-contract/components/setup";
+import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import Long from "long";
 
 export default defineComponent({
     name: 'delete-spot-contract',
@@ -201,7 +203,7 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_delete');
-        const  { loading, orderContractState } = changeOrderContract()
+        const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             Modal.confirm({
@@ -209,8 +211,13 @@ export default defineComponent({
                 okText: '确认删除',
                 cancelText: '取消',
                 onOk() {
+                    let params: GldErmcpSpotContractOperateReq = {
+                        SpotContractID: props.selectedRow.spotcontractid,
+                        OperateType: 3,
+                        Remark: "",
+                    }
                     // 删除客户资料
-                    orderContractState(props.selectedRow.spotcontractid, 3)
+                    orderContractControl(params, loading)
                         .then(res => {
                             // 通知上层  刷新数据
                             context.emit('refresh');

+ 10 - 4
src/views/information/spot-contract/components/finish/index.vue

@@ -187,8 +187,10 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
-import { OrderContractControl} from "@/views/information/spot-contract/components/setup";
+import {orderContractOperateControl} from "@/views/information/spot-contract/components/setup";
 import {message, Modal} from "ant-design-vue";
+import {SpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import Long from "long";
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -201,17 +203,21 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_finish');
-        const {loading, orderContractState} = OrderContractControl()
         const maskClosableFlag = ref<boolean>(false);
+        const loading = ref<boolean>(false);
         function submit() {
-            loading.value = true;
             Modal.confirm({
                 title: '是否确认完结',
                 okText: '确认完结',
                 cancelText: '取消',
                 onOk() {
+                    const params: SpotContractOperateReq = {
+                        SpotContractID: props.selectedRow.spotcontractid,
+                        OperateType: 6,
+                        Remark: '',
+                    }
                     // 完结合同
-                    orderContractState(props.selectedRow.spotcontractid, 6)
+                    orderContractOperateControl(params, loading)
                         .then(res => {
                             // 通知上层  刷新数据
                             context.emit('refresh');

+ 100 - 64
src/views/information/spot-contract/components/setup.ts

@@ -1,85 +1,121 @@
-import { getRequestResultInfo } from "@/common/methods/request";
+import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
+import { QueryAccMgrLoginUser } from "@/services/go/ermcp/account";
+import { ErmcpLoginUser } from "@/services/go/ermcp/account/interface";
 import { orderContract, spotContractStatus } from "@/services/proto/spotcontract";
 import {
     GldErmcpSpotContractOperateReq,
-    GldSpotContractInfo,
     SpotContractOperateReq
 } from "@/services/proto/spotcontract/interface";
 import { ContractStateSign, GldContractStateSign } from "@/views/information/spot-contract/setup";
 import { message } from "ant-design-vue";
 import Long from 'long';
-import { ref } from "vue";
+import { ref, Ref } from "vue";
+import { Value } from "./check/interface";
 
 /**
- * 合同操作相关
+ * 合同操作相关 针对操作类型 1: 保存草稿  2: 提交申请 3: 删除成功 4:审核通过
+ * @param reqs GldErmcpSpotContractOperateReq
+ * @param loading 
+ * @returns 
  */
-export function changeOrderContract() {
-    const loading = ref<boolean>(false);
-
-    /**
-     * 合同操作
-     * @param id 合同id
-     * @param type 操作类型 1: 保存草稿  2: 提交申请 3: 删除成功 4:审核通过
-     * @param info 合同信息
-     */
-    function orderContractState(id: string, type: number, info?: GldSpotContractInfo): Promise<string> {
-        loading.value = true
-        const reqs: GldErmcpSpotContractOperateReq = info === undefined ? {
-            SpotContractID: Long.fromString(id),
-            OperateType: type,
-            Remark: '',
-        } : {
-            SpotContractID: Long.fromString(id),
-            OperateType: type,
-            Remark: '',
-            Info: info,
-        }
-
-        const sign = getRequestResultInfo(GldContractStateSign, type)  // 接口请求后的返回提示 这里统一进行管理
-        return orderContract(reqs)
-            .then(res => {
-                message.success(sign[0])
-                return Promise.resolve(sign[0])
-            })
-            .catch(err => {
-                message.error(sign[1] + err)
-                return Promise.reject(sign[1] + err)
-            }).finally(() => {
-                loading.value = false
-            })
+export function orderContractControl(reqs: GldErmcpSpotContractOperateReq, loading: Ref<boolean>): Promise<string> {
+    //处理 合同id
+    if (reqs.SpotContractID) {
+        reqs.SpotContractID = Long.fromString(reqs.SpotContractID)
     }
-
-    return { loading, orderContractState }
+    // loading 效果
+    loading.value = true
+    // 获取提示信息
+    const sign = getRequestResultInfo(GldContractStateSign, reqs.OperateType)  // 接口请求后的返回提示 这里统一进行管理
+    // 接口调用
+    const result = orderContract(reqs)
+    // 接口调用结果处理,提示成功或者失败信息,并关闭loading效果
+    return commonResultInfo(result, sign, loading)
 }
 
 /**
- * 修改合同类型
- * 4:审核拒绝 6:正常完结 5:撤销
+ * 修改合同类型 针对操作类型 4:审核拒绝 6:正常完结 5:撤销
+ * @param reqs 
+ * @param loading 
+ * @returns 
  */
-export function OrderContractControl() {
-    const loading = ref<boolean>(false);
+export function orderContractOperateControl(reqs: SpotContractOperateReq, loading: Ref<boolean>): Promise<string> {
+    //处理 合同id
+    if (reqs.SpotContractID) {
+        reqs.SpotContractID = Long.fromString(reqs.SpotContractID)
+    }
+    // loading 效果
+    loading.value = true
+    // 获取提示信息
+    const sign = getRequestResultInfo(ContractStateSign, reqs.OperateType)  // 接口请求后的返回提示 这里统一进行管理
+    // 接口调用
+    const result = spotContractStatus(reqs)
+    // 接口调用结果处理,提示成功或者失败信息,并关闭loading效果
+    return commonResultInfo(result, sign, loading)
+}
 
-    function orderContractState(id: string, type: number): Promise<string> {
-        loading.value = true
-        const reqs: SpotContractOperateReq = {
-            SpotContractID: Long.fromString(id),
-            OperateType: type,
-            Remark: '',
+/**
+ * 处理 /账号列表: 交易用户 业务员 跟单员
+ * @returns 
+ */
+export function handleAccountManager() {
+    // 交易用户
+    const traderList = ref<Value[]>([])
+    function getRoleList() {
+        QueryAccMgrLoginUser(2).then(res => {
+            const set = new Set<number>([])
+            traderList.value.length = 0;
+            res.forEach(e => {
+                const { roleid, rolename, accountstatus } = e;
+                if (accountstatus === 4) {  // 账户的状态 - 4 正常
+                    if (!set.has(roleid)) { // 去重
+                        set.add(roleid)
+                        traderList.value.push({ id: roleid, name: rolename })
+                    }
+                }
+            })
+        }).catch(err => message.error(err))
+    }
+    // 处理 跟单员 /  业务员 列表
+    function handleList(el: ErmcpLoginUser, type: string, set: Set<number>): Value | null {
+        const { loginstatus, userid, accountname, logincode, roletype } = el;
+        let result = null
+        if (loginstatus === 1) {// 登录账户状态 - 1:正常 
+            if (roletype.includes(type)) {  // 过滤角色类型
+                if (!set.has(userid)) { // 去重
+                    set.add(userid)
+                    result = { id: userid, name: `${accountname}-${logincode}` }
+                }
+            }
         }
-        const sign = getRequestResultInfo(ContractStateSign, type)  // 接口请求后的返回提示 这里统一进行管理
-        return spotContractStatus(reqs)
-            .then(res => {
-                message.success(sign[0])
-                return Promise.resolve(sign[0])
+        return result
+    }
+    // 业务员
+    const businesserList = ref<Value[]>([])
+    // 跟单员
+    const merchandiserList = ref<Value[]>([])
+    function getBusinesserList() {
+        QueryAccMgrLoginUser(1).then(res => {
+            const bSet = new Set<number>([]);
+            const mSet = new Set<number>([]);
+            const list: ErmcpLoginUser[] = []
+            res.forEach(e => {
+                // eslint-disable-next-line prefer-spread
+                list.push.apply(list, e.userlist)
             })
-            .catch(err => {
-                message.error(sign[1] + err)
-                return Promise.reject(sign[1] + err)
-            }).finally(() => {
-                loading.value = false
+            list.forEach(el => {
+                // 业务员
+                const b = handleList(el, '22', bSet)
+                if (b) {
+                    businesserList.value.push(b)
+                }
+                // 跟单员
+                const m = handleList(el, '23', mSet)
+                if (m) {
+                    merchandiserList.value.push(m)
+                }
             })
+        }).catch(err => message.error(err))
     }
-
-    return { loading, orderContractState }
-}
-
+    return { traderList, businesserList, merchandiserList, getRoleList, getBusinesserList }
+}

+ 1 - 1
src/views/manage/business-review/components/settlementDetail/index.vue

@@ -10,7 +10,7 @@
     <template #footer>
       <a-button key="submit"
                 type="primary"
-                :loading="loading.loading"
+                :loading="loading"
                 @click="submit">关闭</a-button>
     </template>
 

+ 103 - 22
src/views/manage/business-review/components/somepriceAudit/index.vue

@@ -1,28 +1,106 @@
 <template>
-  <!-- 点价审核-->
-  <a-modal class="business_review_someprice_audit custom-detail"
-           title="点价审核"
-           v-model:visible="visible"
-           centered
-           :maskClosable="maskClosableFlag"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading.loading"
-                @click="submit">关闭</a-button>
-    </template>
-
-  </a-modal>
+    <!-- 点价审核-->
+    <a-modal  class="add-custom custom-detail"
+             title="点价审核"
+             v-model:visible="visible"
+             centered
+             :maskClosable="maskClosableFlag"
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">关闭
+            </a-button>
+        </template>
+        <a-form class="inlineForm"
+                :form="form"
+                @submit="handleSearch">
+            <fieldset class="formFieldSet">
+                <legend>合同基本信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="合同编号">
+                            <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价类型">
+                            <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="销售方">
+                            <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="现货品种">
+                            <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+            <fieldset class="formFieldSet">
+                <legend>待审核登记信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="点价合约">
+                            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价价格">
+                            <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="升贴水">
+                            <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价数量">
+                            <span class="white">{{ formatValue(selectedRow.pricedQty) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="点价金额">
+                            <span class="white">{{ formatValue(selectedRow.pricedPrice) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="登记时间">
+                            <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="登记人">
+                            <span class="white">{{ formatValue(selectedRow.auditname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-import { getStatusName } from '@/views/information/custom/setup';
-import { formatValue, formatTime } from '@/common/methods';
+import {defineComponent, PropType, ref} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {QueryCustomInfoType} from '@/services/go/ermcp/customInfo/interface';
+import {getStatusName} from '@/views/information/custom/setup';
+import {formatValue, formatTime} from '@/common/methods';
+import {getPriceTypeName} from "@/views/business/purchase/setup";
 
 export default defineComponent({
     name: 'business_review_someprice_audit',
@@ -34,9 +112,10 @@ export default defineComponent({
         },
     },
     setup(props) {
-        const { visible, cancel } = closeModal('business_review_someprice_audit');
+        const {visible, cancel} = closeModal('business_review_someprice_audit');
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
+
         function submit() {
             loading.value = true;
             setTimeout(() => {
@@ -44,6 +123,7 @@ export default defineComponent({
                 cancel();
             }, 2000);
         }
+
         return {
             visible,
             cancel,
@@ -52,6 +132,7 @@ export default defineComponent({
             formatValue,
             getStatusName,
             maskClosableFlag,
+            getPriceTypeName,
         };
     },
 });

+ 119 - 41
src/views/manage/business-review/components/somepriceCancel/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 撤销点价登记-->
-  <a-modal class="business_review_someprice_cancel custom-detail"
+  <a-modal class="add-custom custom-detail"
            title="撤销点价登记"
            v-model:visible="visible"
            centered
@@ -10,58 +10,136 @@
     <template #footer>
       <a-button key="submit"
                 type="primary"
-                :loading="loading.loading"
-                @click="submit">关闭</a-button>
+                :loading="loading"
+                @click="submit">关闭
+      </a-button>
     </template>
-
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <fieldset class="formFieldSet">
+        <legend>合同基本信息</legend>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="合同编号">
+              <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="点价类型">
+              <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="销售方">
+              <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="现货品种">
+              <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </fieldset>
+      <fieldset class="formFieldSet">
+        <legend>待审核登记信息</legend>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="点价合约">
+              <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="点价价格">
+              <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="升贴水">
+              <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="点价数量">
+              <span class="white">{{ formatValue(selectedRow.pricedQty) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="点价金额">
+              <span class="white">{{ formatValue(selectedRow.pricedPrice) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="登记时间">
+              <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="登记人">
+              <span class="white">{{ formatValue(selectedRow.auditname) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </fieldset>
+    </a-form>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, reactive, ref, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-import { mergeObj } from '@/utils/objHandle';
-import { getStatusName } from '@/views/information/custom/setup';
-import { formatValue, formatTime } from '@/common/methods';
+import {defineComponent, PropType, reactive, ref, watchEffect} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {QueryCustomInfoType} from '@/services/go/ermcp/customInfo/interface';
+import {mergeObj} from '@/utils/objHandle';
+import {getStatusName} from '@/views/information/custom/setup';
+import {formatValue, formatTime} from '@/common/methods';
+import {getPriceTypeName} from "@/views/information/spot-contract/setup";
+import {QryBusinessDjRsp} from "@/services/go/ermcp/business-review/interface";
 
 export default defineComponent({
-    name: 'business_review_someprice_cancel',
-    components: {},
-    props: {
-        selectedRow: {
-            type: Object as PropType<QueryCustomInfoType>,
-            default: {},
-        },
-    },
-    setup(props) {
-        const { visible, cancel } = closeModal('business_review_someprice_cancel');
-        const loading = ref<boolean>(false);
-        const maskClosableFlag = ref<boolean>(false);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
-        }
-        return {
-            visible,
-            cancel,
-            submit,
-            loading,
-            formatValue,
-            getStatusName,
-            maskClosableFlag,
-        };
+  name: 'business_review_someprice_cancel',
+  components: {},
+  props: {
+    selectedRow: {
+      type: Object as PropType<QryBusinessDjRsp>,
+      default: {},
     },
+  },
+  setup(props) {
+    const {visible, cancel} = closeModal('business_review_someprice_cancel');
+    const loading = ref<boolean>(false);
+    const maskClosableFlag = ref<boolean>(false);
+
+    function submit() {
+
+    }
+
+    return {
+      visible,
+      cancel,
+      submit,
+      loading,
+      formatValue,
+      getStatusName,
+      maskClosableFlag,
+      getPriceTypeName,
+    };
+  },
 });
 </script>
 
 <style lang="less">
 .business_review_someprice_cancel {
-    .ant-form.inlineForm {
-        margin-top: 20px;
-    }
+  .ant-form.inlineForm {
+    margin-top: 20px;
+  }
 }
 </style>;

+ 105 - 28
src/views/manage/business-review/components/somepriceDetail/index.vue

@@ -1,50 +1,126 @@
 <template>
-  <!-- 点价记录详情-->
-  <a-modal class="someprice-detail custom-detail"
-           title="点价记录详情"
-           v-model:visible="visible"
-           centered
-           :maskClosable="maskClosableFlag"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading.loading"
-                @click="submit">关闭</a-button>
-    </template>
+    <!-- 点价记录详情-->
+    <a-modal class="add-custom custom-detail"
+             title="点价记录详情"
+             v-model:visible="visible"
+             centered
+             :maskClosable="maskClosableFlag"
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">关闭
+            </a-button>
+        </template>
 
-  </a-modal>
+        <a-form class="inlineForm"
+                :form="form"
+                @submit="handleSearch">
+            <fieldset class="formFieldSet">
+                <legend>合同基本信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="合同编号">
+                            <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价类型">
+                            <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="销售方">
+                            <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="现货品种">
+                            <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+            <fieldset class="formFieldSet">
+                <legend>待审核登记信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="点价合约">
+                            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价价格">
+                            <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="升贴水">
+                            <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价数量">
+                            <span class="white">{{ formatValue(selectedRow.pricedQty) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="点价金额">
+                            <span class="white">{{ formatValue(selectedRow.pricedPrice) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="登记时间">
+                            <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="登记人">
+                            <span class="white">{{ formatValue(selectedRow.auditname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, reactive, ref, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-import { mergeObj } from '@/utils/objHandle';
-import { getStatusName } from '@/views/information/custom/setup';
-import { formatValue, formatTime } from '@/common/methods';
+import {defineComponent, PropType, reactive, ref, watchEffect} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {getStatusName} from '@/views/information/custom/setup';
+import {formatValue, formatTime} from '@/common/methods';
+import {QryBusinessDjRsp} from "@/services/go/ermcp/business-review/interface";
+import {getPriceTypeName} from "@/views/business/purchase/setup";
 
 export default defineComponent({
     name: 'someprice-detail',
     components: {},
     props: {
         selectedRow: {
-            type: Object as PropType<QueryCustomInfoType>,
+            type: Object as PropType<QryBusinessDjRsp>,
             default: {},
         },
     },
     setup(props) {
-        const { visible, cancel } = closeModal('detail');
+        const {visible, cancel} = closeModal('detail');
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
+
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+
         }
+
         return {
             visible,
             cancel,
@@ -53,6 +129,7 @@ export default defineComponent({
             formatValue,
             getStatusName,
             maskClosableFlag,
+            getPriceTypeName,
         };
     },
 });

+ 48 - 40
src/views/manage/business-review/list/settlement/index.vue

@@ -1,45 +1,50 @@
 <template>
-  <!-- 管理-业务审核-交收 -->
-  <div class="business-review-js"
-       :loading="loading">
-    <Filter @search="search">
-      <BtnList :btnList="commonBtn" />
-    </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <template #warehousetype="{ text }">
-          <span>{{ getWareHouseType(text) }}</span>
-        </template>
-        <template #warehousestatus="{ text }">
-          <span>{{ getWareHouseStatus(text) }}</span>
-        </template>
-      </a-table>
-    </contextMenu>
-    <!-- 点价记录详情 -->
-    <SettlementDetail />
-    <!-- 交收审核 -->
-    <SettlementAudit />
-    <!-- 撤销点价登记 -->
-    <SettlementCancel />
-  </div>
+    <!-- 管理-业务审核-交收 -->
+    <div class="business-review-js"
+         :loading="loading">
+        <Filter @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </Filter>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+
+
+            </a-table>
+        </contextMenu>
+        <!-- 点价记录详情 -->
+        <SettlementDetail/>
+        <!-- 交收审核 -->
+        <SettlementAudit/>
+        <!-- 撤销点价登记 -->
+        <SettlementCancel/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
 
-import { SettlementDetail, SettlementAudit, SettlementCancel, Filter } from '../../components';
+import {SettlementDetail, SettlementAudit, SettlementCancel, Filter} from '../../components';
 
-import { queryTableList, getFilterTableCB, QryBussinessJsRsp } from './setup';
+import {queryTableList, getFilterTableCB, QryBussinessJsRsp} from './setup';
+import {getPriceTypeName} from "@/views/information/spot-contract/setup";
 
 export default defineComponent({
     name: 'business-review-js',
@@ -53,25 +58,27 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QryBussinessJsRsp>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QryBussinessJsRsp>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('business_review_settlement', true);
+        const {commonBtn, forDataBtn} = getBtnList('business_review_settlement', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList({});
+        const {loading, tableList, queryTable} = queryTableList({});
         initData(() => {
             // 获取列表数据
             queryTable();
             // 注册表头信息 过滤
             registerColumn('table_pcweb_business_aduit_js', getFilterTableCB);
         });
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         return {
             columns,
             filteredInfo,
@@ -83,6 +90,7 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getPriceTypeName,
         };
     },
 });

+ 70 - 40
src/views/manage/business-review/list/someprice/index.vue

@@ -1,44 +1,68 @@
 <template>
-  <!-- 管理-业务审核-点价 -->
-  <div class="business-review-dj"
-       :loading="loading">
-    <Filter @search="search">
-      <BtnList :btnList="commonBtn" />
-    </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <template #warehousetype="{ text }">
-          <span>{{ getWareHouseType(text) }}</span>
-        </template>
-        <template #warehousestatus="{ text }">
-          <span>{{ getWareHouseStatus(text) }}</span>
-        </template>
-      </a-table>
-    </contextMenu>
-    <!-- 点价记录详情 -->
-    <SomepriceDetail />
-    <!-- 点价审核 -->
-    <SomepriceAudit />
-    <!-- 撤销点价登记 -->
-    <SomepriceCancel />
-  </div>
+    <!-- 管理-业务审核-点价 -->
+    <div class="business-review-dj"
+         :loading="loading">
+        <Filter @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </Filter>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+
+                <template #pricetype="{ text }">
+                    <a>{{ getPriceTypeName(text) }}</a>
+                </template>
+
+                <template #applystatus="{ text }">
+                    <a>{{ getApplyStatusName(text) }}</a>
+                </template>
+
+                <template #contracttype="{ text }">
+                    <a>{{ getContractTypeName(text) }}</a>
+                </template>
+
+                <template #contractstatus="{ text }">
+                    <a>{{ getContractStatusName(text) }}</a>
+                </template>
+            </a-table>
+        </contextMenu>
+        <!-- 点价记录详情 -->
+        <SomepriceDetail :selectedRow="selectedRow"
+                         @refresh="queryTable"/>
+        <!-- 点价审核 -->
+        <SomepriceAudit :selectedRow="selectedRow"
+                        @refresh="queryTable"/>
+        <!-- 撤销点价登记 -->
+        <SomepriceCancel :selectedRow="selectedRow"
+                         @refresh="queryTable"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
 
-import { Filter, SomepriceDetail, SomepriceAudit, SomepriceCancel } from '../../components';
-import { queryTableList, getFilterTableCB, QryBusinessDjRsp } from './setup';
+import {Filter, SomepriceDetail, SomepriceAudit, SomepriceCancel} from '../../components';
+import {queryTableList, getFilterTableCB, QryBusinessDjRsp} from './setup';
+import {getPriceTypeName} from "@/views/business/purchase/setup";
+import {getApplyStatusName} from "@/views/manage/business-review/setup";
+import {getContractStatusName, getContractTypeName} from "@/views/information/spot-contract/setup";
 
 export default defineComponent({
     name: 'business-review-dj',
@@ -52,25 +76,27 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QryBusinessDjRsp>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QryBusinessDjRsp>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('business_review_someprice', true);
+        const {commonBtn, forDataBtn} = getBtnList('business_review_someprice', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList({});
+        const {loading, tableList, queryTable} = queryTableList({});
         initData(() => {
             // 获取列表数据
             queryTable();
             // 注册表头信息 过滤
             registerColumn('table_pcweb_business_aduit_dj', getFilterTableCB);
         });
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         return {
             columns,
             filteredInfo,
@@ -82,6 +108,10 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getPriceTypeName,
+            getApplyStatusName,
+            getContractTypeName,
+            getContractStatusName,
         };
     },
 });

+ 25 - 0
src/views/manage/business-review/setup.ts

@@ -0,0 +1,25 @@
+/**
+ * 业务审核-点价-状态
+ * @param type 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
+ */
+export function getApplyStatusName(type: number): string{
+    let result = "--";
+    switch (type) {
+        case 1:
+            result = "待审核";
+            break
+        case 2:
+            result = "审核通过";
+            break
+        case 3:
+            result = "审核拒绝";
+            break
+        case 4:
+            result = "处理失败";
+            break
+        case 5:
+            result = "已撤回";
+            break
+    }
+    return result
+}