Explorar o código

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

Administrator %!s(int64=4) %!d(string=hai) anos
pai
achega
5b5a66fea6
Modificáronse 31 ficheiros con 949 adicións e 280 borrados
  1. 2 1
      public/proto/mtp.proto
  2. 44 0
      src/assets/styles/mixin.less
  3. 0 2
      src/common/components/buttonList/index.vue
  4. 1 1
      src/common/methods/format/index.ts
  5. 2 0
      src/common/methods/request/index.ts
  6. 1 0
      src/common/methods/request/interface.ts
  7. 15 0
      src/common/methods/request/resultInfo.ts
  8. 3 4
      src/layout/components/header.vue
  9. 23 0
      src/services/bus/user.ts
  10. 14 8
      src/services/go/ermcp/goodsInfo/index.ts
  11. 56 0
      src/services/go/ermcp/goodsInfo/interface.ts
  12. 10 11
      src/services/go/useInfo/index.ts
  13. 43 3
      src/services/proto/spotcontract/index.ts
  14. 59 0
      src/services/proto/spotcontract/interface.ts
  15. 1 1
      src/services/request/serviceURL.ts
  16. 9 0
      src/utils/time/index.ts
  17. 1 4
      src/views/information/custom/compoments/filterTable/index.vue
  18. 52 8
      src/views/information/goods/components/add/index.vue
  19. 1 1
      src/views/information/goods/components/filterTable/index.vue
  20. 274 176
      src/views/information/spot-contract/components/add/index.vue
  21. 1 0
      src/views/information/spot-contract/components/add/interface.ts
  22. 186 8
      src/views/information/spot-contract/components/add/setup.ts
  23. 4 4
      src/views/information/spot-contract/components/cancel/index.vue
  24. 39 22
      src/views/information/spot-contract/components/check/index.vue
  25. 3 3
      src/views/information/spot-contract/components/delete/index.vue
  26. 1 0
      src/views/information/spot-contract/components/detail/index.vue
  27. 1 1
      src/views/information/spot-contract/components/filterTable/index.vue
  28. 4 4
      src/views/information/spot-contract/components/finish/index.vue
  29. 92 16
      src/views/information/spot-contract/components/setup.ts
  30. 6 1
      src/views/information/spot-contract/setup.ts
  31. 1 1
      src/views/information/warehouse-info/compoments/filterTable/index.vue

+ 2 - 1
public/proto/mtp.proto

@@ -848,9 +848,10 @@ message GldSpotContractInfo {
 	optional double PricedAmount = 30; // double 已定价金额
 	optional uint64 SpotGoodsBrandID = 31; // uint64 现货品牌ID
 	optional string Remark = 32; // string 合同备注
-	optional uint64 SaleUserID = 33; // uint64 业务员ID
+	optional uint64 SaleUserID = 33; // uint64 业务员IDSpotContractOperateReq
 	optional uint64 AccountID = 34; // uint64 期货账户ID
 	optional uint32 BizType = 35; // uint32 业务类型 - 1:套保 2:套利
+	optional uint32 CurrencyID = 36; // uint32 结算币种ID
 }
 // 合同操作请求 0 29 170
 message ErmcpContractOperateApplyReq {

+ 44 - 0
src/assets/styles/mixin.less

@@ -386,14 +386,22 @@
     .ant-row.ant-form-item {
         margin-bottom: 21px;
         .ant-form-item-label {
+            position: relative;
             width: 130px;
             line-height: 30px;
             text-align: left;
             label {
                 color: @m-grey1;
+                padding-left: 16px;
                 &::after {
                     content: ''
                 }
+                &::before {
+                    .position(absolute, 0, auto, auto, 0);
+                    font-size: 16px;
+                    line-height: 21px;
+                    color: @m-red1;
+                }
             }
         }
         .ant-form-item-control-wrapper {
@@ -612,6 +620,10 @@
         border: 0;
     }
 }
+.operBtn.ant-btn {
+    margin-top: 9px;
+    margin-bottom: 6px;
+}
 .ant-table-expanded-row {
     .btn-list {
         padding-right: 10px;
@@ -686,4 +698,36 @@
     color: @m-grey2;
     margin-left: -8px;
     margin-right: 2px;
+}
+
+.filterTable {
+    display: inline-flex;
+    width: 100%;
+}
+
+.ant-row.dialogRowTitle {
+    margin-left: 0 !important;
+    margin-right: 0 !important;
+    border: 1px solid @m-grey20;
+    .ant-col {
+        border-top: 1px solid @m-grey20;
+        border-right: 1px solid @m-grey20;
+        padding-left: 0 !important;
+        padding-right: 0 !important;
+        height: 34px;
+        line-height: 34px;
+        font-size: 16px;
+        color: @m-grey2;
+        .red {
+            color: @m-red1;
+        }
+    }
+    .ant-col:nth-child(1),.ant-col:nth-child(2),.ant-col:nth-child(3),.ant-col:nth-child(4){
+        border-top: 0;
+        text-align: center;
+    }
+    .ant-col:last-child {
+        border-right: 1px solid @m-grey20;
+    }
+
 }

+ 0 - 2
src/common/components/buttonList/index.vue

@@ -26,7 +26,5 @@ export default defineComponent({
 <style lang="less">
 .btn-list {
   display: inline-flex;
-  padding-top: 9px;
-  padding-bottom: 6px;
 }
 </style>

+ 1 - 1
src/common/methods/format/index.ts

@@ -73,4 +73,4 @@ export function formatTime(value: string | Date, type: TIME) {
     }
     if (value) return moment(value).format(str);
     return value;
-}
+}

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

@@ -0,0 +1,2 @@
+import { getRequestResultInfo } from './resultInfo'
+export { getRequestResultInfo }

+ 1 - 0
src/common/methods/request/interface.ts

@@ -0,0 +1 @@
+export type ResultInfo = [string, string]

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

@@ -0,0 +1,15 @@
+import { ResultInfo } from './interface'
+/**
+ * 获取
+ * @param map 
+ * @param type 
+ * @returns 
+ */
+export function getRequestResultInfo(map: Map<number, ResultInfo>, type: number): ResultInfo {
+    if (map.has(type)) {
+        const result = map.get(type) as ResultInfo
+        return result
+    } else {
+        return ['成功', '失败']
+    }
+}

+ 3 - 4
src/layout/components/header.vue

@@ -5,7 +5,7 @@
   </div>
   <div class="m-layout-header-right">
     <div @click="openDrawer">
-      <span>{{ username }},您好!</span>
+      <span>{{ getUserName() }},您好!</span>
     </div>
     <div class="relative">
       <!-- <a-input-search ref="userNameInput"
@@ -46,10 +46,10 @@
 
 <script lang="ts">
 import { defineComponent, ref, provide } from 'vue';
-import APP from '@/services';
 import { openModal } from '@/common/setup/modal/index';
 import { UserOutlined } from '@ant-design/icons-vue';
 import Setting from '@/views/setting/index.vue';
+import { getUserName } from '@/services/bus/user';
 
 // 设置
 const setFn = () => {
@@ -94,11 +94,10 @@ export default defineComponent({
         },
     },
     setup() {
-        const username = APP.get('username');
         const { openAction: openNotice } = openModal('notice');
         return {
-            username,
             openNotice,
+            getUserName,
             ...setFn(),
             ...onSearch(),
         };

+ 23 - 0
src/services/bus/user.ts

@@ -6,4 +6,27 @@ import APP from '@/services';
  */
 export function getUserAccountType() {
     return APP.get('userAccount').usertype
+}
+
+/**
+ * 获取用户
+ */
+export function getUserInfo() {
+    return APP.get('userInfo')
+}
+
+/**
+ * 获取用户名
+ * @returns 
+ */
+export function getUserName() {
+    return getUserInfo().customername
+}
+
+/**
+ * 获取用户id 
+ * 登录中也写了一个 获取用户id的方法,那个方法是在登录信息里面获取用户id,这个方法是在go服务修改登录请求方法,返回用户信息,后期有时间进行优化
+ */
+export function getUsrId() {
+    return getUserInfo().userid
 }

+ 14 - 8
src/services/go/ermcp/goodsInfo/index.ts

@@ -1,17 +1,15 @@
 /** ================================= 信息 - 现货商品信息 ================================**/
 
-import APP from '@/services';
 import { getUserId } from "@/services/bus/account";
+import { getUserAccountType } from "@/services/bus/user";
 import { commonSearch_go } from '@/services/go/index';
 import {
-    DeliveryGoodsDetailReq,
     Ermcp3Brand, Ermcp3GoodsGroup, Ermcp3MiddleGoodsDetailEx,
     Ermcp3Wrstandard,
     ErmcpDeliveryGoodsDetailEx,
     ErmcpDeliveryGoodsReq,
-    ErmcpDeliveryGoodsRsp, ErmcpMiddleGoodsModel
+    ErmcpDeliveryGoodsRsp, ErmcpMiddleGoodsModel, Goods
 } from './interface';
-import {getUserAccountType} from "@/services/bus/user";
 
 /**
  * 查询现货商品 /Ermcp3/QueryDeliveryGoods
@@ -57,10 +55,7 @@ export function QueryGoodsbrand(): Promise<Ermcp3Brand[]> {
  * @constructor
  */
 export function QueryDeliveryGoodsDetail(deliverygoodsid?: number): Promise<ErmcpDeliveryGoodsDetailEx[]> {
-    const req :DeliveryGoodsDetailReq = {
-        deliverygoodsid: deliverygoodsid,
-        userid: getUserId()
-    }
+    const req = deliverygoodsid ? { deliverygoodsid, userid: getUserId() } : { userid: getUserId() }
     return commonSearch_go('/Ermcp3/QueryDeliveryGoodsDetail', req).catch((err) => {
         throw new Error(`查询现货商品详情: ${err.message}`);
     });
@@ -106,3 +101,14 @@ export function QueryMiddleGoodsDetail(middlegoodsid: number): Promise<Ermcp3Mid
     });
 }
 
+/**
+ * 查询企业风管期货商品信息 /Ermcp/GetErmcpGoods
+ * @param lastUpdateTime 最后修改时间 - 闭区间,格式:yyyy-MM-dd HH:mm:ss
+ * @constructor
+ */
+export function GetErmcpGoods(lastUpdateTime?: string): Promise<Goods[]> {
+    return commonSearch_go('/Ermcp3/QueryMiddleGoodsDetail', { lastUpdateTime }).catch((err) => {
+        throw new Error(`查询企业风管期货商品信息: ${err.message}`);
+    });
+}
+

+ 56 - 0
src/services/go/ermcp/goodsInfo/interface.ts

@@ -238,6 +238,62 @@ export interface ErmcpDeliveryGoodsDetail2{
     gmlist: Ermcp3Wrstandard[] // 品类列表(仓单标准)
 }
 
+/**
+ * 期货商品信息
+ */
+export interface Goods{
+    agreeunit	:number;//合约单位
+    auditaccountid	:number;//审核操作员账号
+    audittime	:string;//审核时间
+    cancelaccountid	:number;//注销操作员账号
+    canceltime	:string;//注销时间
+    closepricemode	:number;//强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)
+    closepriceparam	:number;//强平最新价浮动比例 - 方式为2时使用 (<1)买 上浮 (1+x)最新价卖 下浮 (1-x)最新价
+    createtime	:string;//创建时间
+    creatorid	:number;//创建人
+    currencyid	:number;//报价货币ID
+    cutmode	:number;//斩仓方式 - 1:不斩仓 2:自动斩仓 3:半自动斩仓
+    decimalplace	:number;//报价小数位
+    delistingdate	:string;//商品退市时间(状态:退市) – 已作废
+    delistingmode	:number;//退市方式 - 1:退市平仓 2:退市交收 3:不处理(仅期权\币币兑换)
+    deliveryflag	:number;//交割标志 - number;
+//:不可交割 1:可交割
+    forceclosemode	:number;//定期强平方式 - 1:无 2:每日 3:每周 4:每月[收益权]
+    forceclosevalue	:number;//定期强平参数 [收益权]
+    goodscode	:string;//商品代码(内部)
+    goodscurrencyid	:number;//合约货币ID
+    goodsgroupid	:number;//所属商品组ID
+    goodsid	:number;//商品ID(自增ID SEQ_GOODS)
+    goodsname	:string;//商品名称
+    goodsquotetype	:number;//合约报价类型: 1-直接报价 2-间接报价
+    goodsstatus	:number;//商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
+    goodstradetype	:number;//商品交易权限类型 - 1:可建可平 3:不可建可平
+    goodunitid	:number;//报价单位ID
+    hasquoter	:number;//是否有报价商 - number;
+//:无报价商 1:有报价商
+    hqprotecttime	:number;//行情保护时间(秒)
+    innerdealmode	:number;//内部成交方式[通道交易] - 1:净头寸 2:开平 3:平今
+    isbuylimited	:number;//是否限制建仓量 - number;
+//:不限制 1:限制
+    lasttradedate	:string;//最后交易日期(状态:待退市)
+    listingdate	:string;//交易开始日期
+    marketid	:number;//所属市场ID
+    modifierid	:number;//修改人
+    modifystatus	:number;//变更状态 - 1:未变更 2:变更中 3:待审核 4:已审核
+    modifytime	:string;//修改时间
+    outerdealmode	:number;//外部成交方式[通道交易]- 1:净头寸 2:开平 3:平今
+    outgoodscode	:string;//商品代码(外部)
+    qtydecimalplace	:number;//成交量小数位
+    quotegear	:number;//行情档位(1-1number;
+//)
+    quoteminunit	:number;//行情最小变动单位 [整数,报价小数位一起使用]
+    quoteshowtype	:number;//行情报价类型: 1:成交价 2:买卖中间价 3:含买价 4:含卖价做市模式固定为3:含买价
+    quoteshowtypeinterval	:number;//行情报价间隔时间(秒)(成交价时为number;
+//)
+    remark	:string;//备注
+}
+
+
 
 interface MenuItem {
     key: string;

+ 10 - 11
src/services/go/useInfo/index.ts

@@ -1,7 +1,7 @@
-import { commonSearch_go } from '../index'
-import * as type from './interface'
 import APP from '@/services';
 import { getLongTypeLoginID } from '@/services/bus/login';
+import { commonSearch_go } from '../index';
+import * as type from './interface';
 
 /**
  * 获取登录ID
@@ -30,13 +30,13 @@ export function LoginQuery(): Promise<type.LoginQueryRsp> {
     const id = getLongTypeLoginID();
     return commonSearch_go('/User/LoginQuery', { loginID: Number(id) }).then(res => {
         const { externalExchanges,
-                goodsgroups,
-                loginAccount,
-                markets,
-                systemParams,
-                userAccount,
-                userInfo,
-                username }= res;
+            goodsgroups,
+            loginAccount,
+            markets,
+            systemParams,
+            userAccount,
+            userInfo,
+            username } = res;
         externalExchanges && APP.set('externalexchange', externalExchanges);
         goodsgroups && APP.set('goodsgroups', goodsgroups);
         loginAccount && APP.set('loginAccount', loginAccount);
@@ -46,7 +46,6 @@ export function LoginQuery(): Promise<type.LoginQueryRsp> {
         userInfo && APP.set('userInfo', userInfo);
         username && APP.set('username', username);
         console.log('LoginQuery', res);
-
         return res
     })
 }
@@ -56,6 +55,6 @@ export function LoginQuery(): Promise<type.LoginQueryRsp> {
  * @returns
  */
 export function QueryUserInfo(userID: number, isDecrypt?: boolean): Promise<type.Userinfo> {
-    const param = isDecrypt ? { isDecrypt, userID } : {userID }
+    const param = isDecrypt ? { isDecrypt, userID } : { userID }
     return commonSearch_go('/User/QueryUserInfo', param)
 }

+ 43 - 3
src/services/proto/spotcontract/index.ts

@@ -1,14 +1,14 @@
 import APP from "@/services";
 import { getSelectedAccountId, getUserId } from "@/services/bus/account";
-import { GldErmcpSpotContractOperateReq } from "@/services/proto/spotcontract/interface";
+import {GldErmcpSpotContractOperateReq, SpotContractOperateReq} from "@/services/proto/spotcontract/interface";
 import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
 import { Callback } from "@/utils/websocket";
 import { v4 as uuidv4 } from 'uuid';
+import {getTimeValue} from "@/utils/time";
 
 /**(重点提醒 这里属于管理端接口,仅用于新增)以上来自android代码  回头需要确认
  * 新增 / 修改采购合同报文 (很多修改合同操作也在这)
- * @param
- * @param param
+ * @param param 1:保存草稿2:提交申请3:删除4:审核通过
  */
 export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<any> => {
 
@@ -45,3 +45,43 @@ export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<an
         } as Callback);
     });
 }
+
+/**
+ *现货合同操作请求
+ * @param param 2 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
+ */
+export const spotContractStatus = (param: SpotContractOperateReq): Promise<any> => {
+
+    const OperateSrc = 2; // uint32 操作来源-1:管理端2:终端
+    const ClientTicket: string = uuidv4();  // 客户端流水号
+    const UserID: number = getUserId(); // 用户id
+
+    const reqParams = {
+        ...param, OperateSrc, ClientTicket, UserID
+    }
+    debugger
+    return new Promise((resolve, reject) => {
+        const params = {
+            protobufName: 'SpotContractOperateReq',
+            funCodeName: 'SpotContractOperateReq',
+            reqParams: reqParams,
+            msgHeadParams: {
+                AccountID: getSelectedAccountId(),
+                MarketID: 18,
+                GoodsID: 0,
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'SpotContractOperateRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
+}

+ 59 - 0
src/services/proto/spotcontract/interface.ts

@@ -61,4 +61,63 @@ export interface GldSpotContractInfo {
     SaleUserID: number // uint64 业务员ID
     AccountID: number // uint64 期货账户ID
     BizType: number // uint32 业务类型 - 1:套保 2:套利
+    CurrencyID: number // 结算币种ID
+}
+
+//现货合同操作请求  (一部分操作用这个借口)
+export interface SpotContractOperateReq {
+    SpotContractID: number; // 现货合同id
+    OperateType: number; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
+    Remark: string; // string 操作备注
+    Info?: SpotContractInfo; // SpotContractInfo 现货合同信息
+}
+
+export interface SpotContractInfo {
+    ContractNo: string; // string 现货合同编号
+    ContractType: number; // int32 现货合同类型-1:采购-1:销售
+    UserID: number; // uint32 机构ID
+    BuyUserID: number; // uint32 采购方ID
+    SellUserID: number; // uint32 客户ID
+    SignDate: string; // string 签订日期
+    ContractAttachment: Uint8Array; // bytes 合同附件
+    ContractMargin: number; // double 合同保证金
+    DeliveryGoodsID: number; // uint32 现货品种ID
+    WrStandardID: number; // uint32 现货商品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; // uint32 点价合约ID-0:为现货,其它为期货商品合约ID[2:点价3:暂定价]
+    PriceMove: number; // double 升贴水[2:点价3:暂定价]
+    StartDate: string; // string 点价开始日期[2:点价3:暂定价]
+    EndDate: string; // string 点价结束日期[2:点价3:暂定价]
+    PointDesc: string; // string 点价备注[2:点价3:暂定价]
+    DeliveryDesc: string; // string 交收方式
+    MerUserID: number; // uint32 跟单员ID
+    TradeUserID : number; // uint32 交易员ID
+    PricedQty: number; // double 已定价量
+    PricedAmount: number; // double 已定价金额
+    SpotGoodsBrandID: number; // uint32 现货品牌ID
+    Remark: string; // string 合同备注
+    SaleUserID: number; // uint32 业务员ID
+    AccountID: number; // uint64 期货账户ID
+    BizType: number; // uint32 业务类型 - 1:套保 2:套利
+    WrFactorTypeID: number; // uint64 仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+    CustomerUserID: number; // uint32 客户ID
+    RelatedUserID: number; // uint32 关联用户ID
+}
+
+// 现货合同操作响应 0 18 6
+export interface SpotContractOperateRsp {
+    RetCode: number; // int32 返回码
+    RetDesc: string; // string 描述信息
+    SpotContractID: number; // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
+    OperateType: number; // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
+    OperateSrc: number; // uint32 操作来源-1:管理端2:终端
+    ClientTicket: string; // string 客户端流水号
 }

+ 1 - 1
src/services/request/serviceURL.ts

@@ -71,7 +71,7 @@ export const commonSearchUrl = (url: string): string => {
 };
 
 export const setServiceURL = (config: URL): void => {
-    console.log('URL', config);
+    // console.log('URL', config);
     // 外网环境(175),外包同事使用
     if (process.env.NODE_ENV === 'development') {
         serviceURL.goCommonSearchUrl = 'http://218.17.158.45:21001/api';

+ 9 - 0
src/utils/time/index.ts

@@ -0,0 +1,9 @@
+import moment from "moment";
+
+/**
+ * 获取number类型时间戳
+ * @returns 
+ */
+export function getTimeValue(): number {
+    return moment().valueOf()
+}

+ 1 - 4
src/views/information/custom/compoments/filterTable/index.vue

@@ -44,8 +44,5 @@ export default defineComponent({
 </script>
 
 <style lang="less">
-.filterTable {
-    display: inline-flex;
-    width: 100%;
-}
+
 </style>;

+ 52 - 8
src/views/information/goods/components/add/index.vue

@@ -63,7 +63,7 @@
                          name="remark">
               <a-input class="dialogInput"
                        v-model:value="formState.remark"
-                       style="width: 562px"
+                       style="width: 588px"
                        placeholder="请输入备注" />
             </a-form-item>
           </a-col>
@@ -71,7 +71,7 @@
       </fieldset>
       <fieldset class="formFieldSet">
         <legend>品类信息</legend>
-        <a-row :gutter="24">
+        <a-row :gutter="24"  class="dialogRowTitle">
           <a-col :span="6">
             <span>
               <span class="red">*</span>
@@ -109,7 +109,6 @@
               <a-form-item :name="['gldwrstandards',index,'unitid' ]"
                            :rules="rules.gldwrstandards.unitid">
                 <a-select class="inlineFormSelect"
-                          style="width: 200px"
                           v-model:value="domain.unitid"
                           placeholder="请选择单位">
                   <a-select-option v-for="item in unitList"
@@ -129,7 +128,7 @@
                          placeholder="请输入标仓系数"></a-input>
               </a-form-item>
             </a-col>
-            <a-col :span="6">
+            <a-col :span="6" class="tc">
               <a-button class="plusBtn"
                         @click="deleteOne('gldwrstandards', index)"
                         v-if="index > 0">
@@ -203,7 +202,7 @@
       </fieldset>
       <fieldset class="formFieldSet">
         <legend>品牌信息</legend>
-        <a-row :gutter="24">
+        <a-row :gutter="24" class="dialogRowTitle dialogRowTitle2">
           <a-col :span="12">
             <span>
               <span class="red">*</span>
@@ -272,7 +271,7 @@
       </fieldset>
       <fieldset class="formFieldSet">
         <legend>套保品种信息</legend>
-        <a-row :gutter="24">
+        <a-row :gutter="24"  class="dialogRowTitle">
           <a-col :span="6">
             <span>
               <span class="red">*</span>
@@ -302,7 +301,6 @@
               <a-form-item :name="['wrsconvertdetails',index,'middlegoodsid']"
                            :rules="rules.wrsconvertdetails.middlegoodsid">
                 <a-select class="inlineFormSelect"
-                          style="width: 200px"
                           @change="middleChange(domain.middlegoodsid, domain)"
                           v-model:value="domain.middlegoodsid"
                           placeholder="请选择套保品种">
@@ -331,7 +329,7 @@
                          placeholder="请输入套保系数"></a-input>
               </a-form-item>
             </a-col>
-            <a-col :span="6">
+            <a-col :span="6" class="tc">
               <a-button class="plusBtn"
                         @click="deleteOne('wrsconvertdetails', index)"
                         v-if="index > 0">
@@ -720,5 +718,51 @@ export default defineComponent({
             }
         }
     }
+    .ant-form.inlineForm {
+      .ant-row.dialogRowTitle {
+        .ant-col {
+          .ant-row.ant-form-item {
+              .ant-col.ant-form-item-control-wrapper {
+                width: 100%;
+                .ant-form-item-control {
+                  .ant-form-item-children {
+                    .ant-input.dialogInput {
+                      border-radius: 0;
+                      margin-top: 1px;
+                      // margin-left: -1px;
+                      // width: calc(100% + 2px);
+                    }
+                    .ant-select.inlineFormSelect {
+                      margin-top: 1px;
+                      .ant-select-selector {
+                        text-align: left;
+                      }
+                    }
+                  }
+                }
+                .ant-form-item-control.has-error {
+                  text-align: left;
+                  .ant-form-item-children {
+                    .ant-input.dialogInput {
+                      background: @m-grey21;
+                    }
+                  }
+                  .ant-form-explain {
+                    color: @m-red1;
+                  }
+                }
+              }
+          }
+        }
+        .ant-col.tc {
+          text-align: center;
+        }
+      }
+      .ant-row.dialogRowTitle2 {
+        .ant-col:nth-child(3),.ant-col:nth-child(4) {
+          border-top: 1px solid @m-grey20;
+        }
+      }
+  }
 }
 </style>

+ 1 - 1
src/views/information/goods/components/filterTable/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 过滤现货品种表格 -->
-  <div>
+  <div class="filterTable">
     <FilterOption :selectList="selectList"
                   :inputList="inputList"
                   :fixedBtnList="fixedBtnList" />

+ 274 - 176
src/views/information/spot-contract/components/add/index.vue

@@ -24,19 +24,20 @@
         <legend>基本信息</legend>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="合同编号">
+            <a-form-item label="合同编号"
+                         name="ContractNo">
               <a-input class="dialogInput"
                        style="width: 200px"
-                       name="ContractNo"
                        v-model:value="formState.ContractNo"
                        placeholder="请输入合同编号" />
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="合同类型">
+            <a-form-item label="合同类型"
+                         name="ContractType">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
-                        name="ContractType"
+                        @change="contractChange"
                         v-model:value="formState.ContractType"
                         placeholder="请选择合同类型">
                 <a-select-option v-for="item in contractType"
@@ -47,13 +48,11 @@
               </a-select>
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="业务类型">
+            <a-form-item label="业务类型"
+                         name="BizType">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
-                        name="BizType"
                         v-model:value="formState.BizType"
                         placeholder="请选择业务类型">
                 <a-select-option v-for="item in businessType"
@@ -64,28 +63,54 @@
               </a-select>
             </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="销售方">
-              <a-select class="inlineFormSelect"
-                        style="width: 200px"
-                        placeholder="请选择销售方">
-                <!-- 客户资料列表 正常 -->
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
-                </a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
+          <template v-if="isSell">
+            <a-col :span="12">
+              <a-form-item label="采购方"
+                           name="BuyUserID">
+                <a-select class="inlineFormSelect"
+                          style="width: 200px"
+                          v-model:value="formState.BuyUserID"
+                          placeholder="请选择客户">
+                  <!-- 客户资料列表 正常 -->
+                  <a-select-option :value="i"
+                                   v-for="(item, i) in customList"
+                                   :key="item.userid">
+                    {{item.customername}}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="销售方"
+                           name="SellUserID">
+                <span class="white">{{getUserName()}}</span>
+              </a-form-item>
+            </a-col>
+          </template>
+          <template v-else>
+            <a-col :span="12">
+              <a-form-item label="采购方"
+                           name="BuyUserID">
+                <span class="white">{{getUserName()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="销售方"
+                           name="SellUserID">
+                <a-select class="inlineFormSelect"
+                          v-model:value="formState.SellUserID"
+                          style="width: 200px"
+                          placeholder="请选择客户">
+                  <!-- 客户资料列表 正常 -->
+                  <a-select-option :value="i"
+                                   v-for="(item, i) in customList"
+                                   :key="item.userid">
+                    {{item.customername}}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+          </template>
           <a-col :span="12">
             <a-form-item label="合同附件"
                          name="ContractAttachment">
@@ -104,60 +129,68 @@
         <legend>现货信息</legend>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="现货品种">
+            <a-form-item label="现货品种"
+                         name="DeliveryGoodsID">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        @change="deliveryGoodsChange"
+                        v-model:value="formState.DeliveryGoodsID"
                         placeholder="请选择现货品种">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in deliveryGoodsList"
+                                 :key="item.deliverygoodsid"
+                                 :value="item.deliverygoodsid">
+                  {{item.deliverygoodsname}}
                 </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="品类">
+            <a-form-item label="品类"
+                         name="WrStandardID">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        @change="WrStandardChange"
+                        v-model:value="formState.WrStandardID"
                         placeholder="请选择品类">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in gmlist"
+                                 :key="item.wrstandardid"
+                                 :value="item.wrstandardid">
+                  {{item.wrstandardname}}
                 </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="品牌">
+            <a-form-item label="品牌"
+                         name="SpotGoodsBrandID">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        v-model:value="formState.SpotGoodsBrandID"
                         placeholder="请选择品牌">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in gblist"
+                                 :key="item.brandid"
+                                 :value="item.brandid">
+                  {{item.brandname}}
                 </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="标仓系数">
-              <span class="white">输入数量和价格后自动算</span>
+            <a-form-item label="标仓系数"
+                         name="ConvertFactor">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.ConvertFactor"
+                       readonly
+                       placeholder="选择品类后自动填入" />
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row :gutter="24">
           <a-col :span="24">
-            <a-form-item label="商品规格">
+            <a-form-item label="商品规格"
+                         name="SpotGoodsDesc">
               <a-input class="dialogInput"
                        style="width: 200px"
+                       v-model:value="formState.SpotGoodsDesc"
                        placeholder="请输入商品规格" />
             </a-form-item>
           </a-col>
@@ -167,9 +200,11 @@
         <legend>价格信息</legend>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="定价类型">
+            <a-form-item label="定价类型"
+                         name="PriceType">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        v-model:value="formState.PriceType"
                         placeholder="请选择定价类型">
                 <a-select-option v-for="item in priceType"
                                  :key="item.key"
@@ -180,113 +215,146 @@
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="数量">
-              <a-input class="dialogInput suffixGrey"
-                       placeholder="请输入数量"
-                       suffix="单位" />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <!-- 以下是点价的价格信息 start -->
-        <!-- <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价合约">
+            <a-form-item label="结算币种"
+                         name="CurrencyID">
               <a-select class="inlineFormSelect"
+                        v-model:value="formState.CurrencyID"
                         style="width: 200px"
-                        placeholder="请选择点价合约">
-                <a-select-option value="1">
-                  合约一
-                </a-select-option>
-                <a-select-option value="2">
-                  合约二
+                        placeholder="请选择结算币种">
+                <a-select-option v-for="item in payCurrency"
+                                 :key="item.enumdicid"
+                                 :value="item.enumdicname">
+                  {{item.enumdicname}}
                 </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="升贴水">
-              <a-input class="dialogInput suffixGrey" placeholder="请输入升贴水" suffix="元/单位" style="width: 200px"/>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价期">
-              <a-select class="inlineFormSelect"
-                        style="width: 95px"
-                        placeholder="请选择点价期">
-                <a-select-option value="1">
-                  日期一
-                </a-select-option>
-              </a-select>
-              <span class="to">-</span>
-              <a-select class="inlineFormSelect"
-                        style="width: 95px"
-                        placeholder="请选择定价类型">
-                <a-select-option value="1">
-                  日期二
-                </a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="交收期">
-              <a-select class="inlineFormSelect"
-                        style="width: 95px"
-                        placeholder="请选择定价类型">
-                <a-select-option value="1">
-                  日期一
-                </a-select-option>
-              </a-select>
-              <span class="to">-</span>
-              <a-select class="inlineFormSelect"
-                        style="width: 95px"
-                        placeholder="请选择定价类型">
-                <a-select-option value="1">
-                  日期二
-                </a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-        </a-row> -->
-        <!-- 以上是点价的价格信息 end -->
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="价格">
+            <a-form-item label="数量"
+                         name="Qty">
               <a-input class="dialogInput suffixGrey"
-                       placeholder="请输入价格"
-                       suffix="元/单位"
-                       style="width: 200px" />
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="金额"
-                         class="relative">
-              <span class="white">输入数量和价格后自动算</span>
-              <span class="unit">元</span>
+                       v-model:value="formState.Qty"
+                       placeholder="请输入数量"
+                       :suffix="numberUnit" />
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="交收期">
-              <a-select class="inlineFormSelect"
-                        style="width: 95px"
-                        placeholder="请选择定价类型">
-                <a-select-option value="1">
-                  日期一
-                </a-select-option>
-              </a-select>
-              <span class="to">-</span>
-              <a-select class="inlineFormSelect"
-                        style="width: 95px"
-                        placeholder="请选择定价类型">
-                <a-select-option value="1">
-                  日期二
-                </a-select-option>
-              </a-select>
+          <a-col :span="12"
+                 v-if="formState.PriceType === 3">
+            <a-form-item label="暂定价">
+              <a-input class="dialogInput suffixGrey"
+                       :suffix="payCurrencyUnit"
+                       placeholder="请输入暂定价" />
             </a-form-item>
           </a-col>
+          <!-- 以下是点价的价格信息 start -->
+          <template v-if="formState.PriceType === 2 || formState.PriceType === 3">
+            <a-col :span="12">
+              <a-form-item label="点价合约">
+                <a-select class="inlineFormSelect"
+                          style="width: 200px"
+                          placeholder="请选择点价合约">
+                  <a-select-option value="1">
+                    合约一
+                  </a-select-option>
+                  <a-select-option value="2">
+                    合约二
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="升贴水">
+                <a-input class="dialogInput suffixGrey"
+                         placeholder="请输入升贴水"
+                         :suffix="`${payCurrencyUnit}/${numberUnit}`"
+                         style="width: 200px" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="点价期">
+                <a-select class="inlineFormSelect"
+                          style="width: 95px"
+                          placeholder="请选择点价期">
+                  <a-select-option value="1">
+                    日期一
+                  </a-select-option>
+                </a-select>
+                <span class="to">-</span>
+                <a-select class="inlineFormSelect"
+                          style="width: 95px"
+                          placeholder="请选择定价类型">
+                  <a-select-option value="1">
+                    日期二
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="交收期">
+                <a-select class="inlineFormSelect"
+                          style="width: 95px"
+                          placeholder="请选择定价类型">
+                  <a-select-option value="1">
+                    日期一
+                  </a-select-option>
+                </a-select>
+                <span class="to">-</span>
+                <a-select class="inlineFormSelect"
+                          style="width: 95px"
+                          placeholder="请选择定价类型">
+                  <a-select-option value="1">
+                    日期二
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+          </template>
+          <!-- 以上是点价的价格信息 end -->
+          <template v-if="formState.PriceType === 1">
+            <a-col :span="12">
+              <a-form-item label="价格"
+                           name="Price">
+                <a-input class="dialogInput suffixGrey"
+                         v-model:value="formState.Price"
+                         placeholder="请输入价格"
+                         :suffix="`${payCurrencyUnit}/${numberUnit}`"
+                         style="width: 200px" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="金额"
+                           class="relative">
+                <a-input class="dialogInput suffixGrey"
+                         readonly
+                         placeholder="输入数量和价格后自动算"
+                         :suffix="payCurrencyUnit"
+                         style="width: 200px" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="交收期">
+                <a-range-picker v-model:value="deliveryDate"
+                                :disabled-date="disabledDate"
+                                :show-time="{hideDisabledOptions: true}"
+                                format="YYYY-MM-DD" />
+                <!-- <a-select class="inlineFormSelect"
+                          style="width: 95px"
+                          placeholder="请选择定价类型">
+                  <a-select-option value="1">
+                    日期一
+                  </a-select-option>
+                </a-select>
+                <span class="to">-</span>
+                <a-select class="inlineFormSelect"
+                          style="width: 95px"
+                          placeholder="请选择定价类型">
+                  <a-select-option value="1">
+                    日期二
+                  </a-select-option>
+                </a-select> -->
+              </a-form-item>
+            </a-col>
+          </template>
         </a-row>
       </fieldset>
       <fieldset class="formFieldSet">
@@ -296,7 +364,7 @@
             <a-form-item label="保证金">
               <a-input class="dialogInput suffixGrey"
                        placeholder="请输入保证金"
-                       suffix="元" />
+                       :suffix="payCurrencyUnit" />
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -348,7 +416,7 @@
           <a-col :span="24">
             <a-form-item label="备注">
               <a-input class="dialogInput"
-                       style="width: 620px"
+                       style="width: 608px"
                        placeholder="请输入备注" />
             </a-form-item>
           </a-col>
@@ -362,7 +430,8 @@
 import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods';
-import { handleFromState } from './setup';
+import { handleFromState, handleContract, handlevalidate, handleDeliveryGoods, handlePrice, handleDate } from './setup';
+import { getUserName } from '@/services/bus/user';
 
 export default defineComponent({
     name: 'add-spot-contract',
@@ -373,25 +442,33 @@ export default defineComponent({
 
         // 表单
         const formRef = ref();
-        const { formState, contractType, priceType, businessType } = handleFromState();
-        // const rules = {
-        //     deliverygoodsname: [{ required: true, message: '请输入现货品种名称', trigger: 'blur' }],
-        //     // unitid: [{ required: true, message: '请选择单位', trigger: 'change' }],
-        //     unitid: [{ required: true, validator: validateUnit, trigger: 'change' }],
-        //     gldwrstandards: {
-        //         unitid: { required: true, validator: validateUnit, trigger: 'change' },
-        //         wrstandardname: { required: true, message: '请输入品类', trigger: 'blur' },
-        //         convertfactor: { required: true, message: '请输入标仓系数', trigger: 'blur' },
-        //     },
-        //     glddgfactoryItems: {
-        //         dgfactoryitemvalue: { required: true, message: '请输入品牌', trigger: 'blur' },
-        //     },
-        //     wrsconvertdetails: {
-        //         middlegoodsid: { required: true, validator: valideteWR, trigger: 'change' },
-        //         convertratio: { required: true, message: '请输入套保系数', trigger: 'blur' },
-        //     },
-        // };
-
+        const { formState, businessType } = 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 } = 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' }],
+            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' }],
+        };
+        //  处理现货商品
+        const { deliveryGoodsList, gblist, gmlist, numberUnit, WrStandardChange, getDeliveryGoods, deliveryGoodsChange } = handleDeliveryGoods(formState);
+        // 价格信息
+        const { priceType, payCurrency, payCurrencyUnit, parCurrencyChange } = handlePrice(formState);
+        // 日期
+        const { deliveryDate, disabledDate } = handleDate();
         function submit() {
             loading.value = true;
             setTimeout(() => {
@@ -399,17 +476,36 @@ export default defineComponent({
                 cancel();
             }, 2000);
         }
-        initData(() => {});
+        initData(() => {
+            queryCustomList();
+            getDeliveryGoods();
+        });
         return {
             visible,
             cancel,
             submit,
             loading,
             maskClosableFlag: false,
+            formState,
+            rules,
+            businessType,
             contractType,
+            isSell,
+            contractChange,
+            customList,
+            deliveryGoodsList,
+            gblist,
+            gmlist,
+            deliveryGoodsChange,
+            WrStandardChange,
             priceType,
-            businessType,
-            formState,
+            payCurrency,
+            payCurrencyUnit,
+            parCurrencyChange,
+            numberUnit,
+            getUserName,
+            deliveryDate,
+            disabledDate,
         };
     },
 });
@@ -417,5 +513,7 @@ export default defineComponent({
 
 <style lang="less">
 .add-spot-contract {
+ 
+
 }
 </style>;

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

@@ -34,4 +34,5 @@ export interface FormState {
     SaleUserID: number | undefined // uint64 业务员ID
     AccountID: number | undefined // uint64 期货账户ID
     BizType: number // uint32 业务类型 - 1:套保 2:套利
+    CurrencyID: number | undefined // 结算币种ID
 }

+ 186 - 8
src/views/information/spot-contract/components/add/setup.ts

@@ -1,4 +1,13 @@
-import { reactive, UnwrapRef } from 'vue';
+import { validateCommon } from '@/common/setup/validate';
+import { getItemEnum } from '@/services/bus/allEnum';
+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 { 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 { FormState } from "./interface";
 
 export function handleFromState() {
@@ -24,23 +33,192 @@ export function handleFromState() {
         SaleUserID: undefined, // uint64 业务员ID
         MerUserID: undefined, // uint64 跟单员ID
         AccountID: undefined, // uint64 期货账户ID
-        Remark: '' // string 合同备注
+        Remark: '', // string 合同备注
+        CurrencyID: undefined, // 结算币种ID
     })
+    // 业务类型
+    const businessType = [
+        { key: 1, value: '套保' },
+        { key: 2, value: '套利' },
+    ];
+    return { formState, businessType }
+}
+/**
+ * 合同类型
+ */
+export function handleContract() {
     // 合同类型
     const contractType = [
         { key: 1, value: '采购' },
         { key: -1, value: '销售' },
     ];
+    const isSell = ref<boolean>(false)  // true => 销售 false => 采购
+    /**
+     * 合同类型变更
+     */
+    function contractChange(value: number) {
+        isSell.value = value === 1 ? false : true;
+    }
+    const customList = ref<QueryCustomInfoType[]>([])
+    function queryCustomList() {
+        QueryCustomInfo(3)
+            .then((res) => {
+                customList.value = res
+                console.log('客户资料', customList);
+            })
+            .catch((err) => {
+                message.error(err);
+            })
+    }
+    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, '请选择结算币种')
+    }
+
+    return {
+        v_ContractType, v_BizType, v_BuyUser, v_SellUser, v_DeliveryGoods, v_WrStandard,
+        v_SpotGoodsBrand, v_PriceType, v_Currency
+    }
+}
+
+/**
+ * 处理现货商品
+ */
+export function handleDeliveryGoods(formState: UnwrapRef<FormState>) {
+    // 现货品种
+    const deliveryGoodsList = ref<ErmcpDeliveryGoodsRsp[]>([])
+    // 品牌
+    const gblist = ref<Ermcp3Brand[]>([])
+    // 品类列表
+    const gmlist = ref<Ermcp3Wrstandard[]>([])
+
+    // 查询现货商品
+    function getDeliveryGoods() {
+        QueryDeliveryGoods({}).then(res => {
+            console.log('查询现货商品', res);
+            deliveryGoodsList.value = res;
+        }).catch(err => {
+            message.error(err)
+        })
+    }
+    // 切换现货商品
+    function deliveryGoodsChange(value: number | undefined) {
+        if (value !== undefined) {
+            getDeliveryGoodsDetail(value)
+        } else {
+            gblist.value.length = 0
+            gmlist.value.length = 0
+        }
+    }
+    // 查询现货商品详情
+    function getDeliveryGoodsDetail(deliverygoodsid: number) {
+        QueryDeliveryGoodsDetail(deliverygoodsid).then(res => {
+            if (res.length) {
+                gblist.value = res[0].gblist
+                gmlist.value = res[0].gmlist
+            }
+            console.log('查询品类', res);
+        }).catch(err => {
+            message.error(err)
+        })
+    }
+    const numberUnit = ref<string>('')
+    // 品类变更
+    function WrStandardChange(value: number) {
+        const obj = gmlist.value.find((e) => e.wrstandardid === value);
+        if (obj) {
+            //标仓系数
+            formState.ConvertFactor = obj.convertfactor;
+            // 单位
+            const unitInfo = getItemEnum('goodsunit').find(e => e.enumitemname === obj.unitid)
+            if (unitInfo) {
+                numberUnit.value = unitInfo.enumdicname
+            }
+        }
+    }
+    return { deliveryGoodsList, gblist, gmlist, numberUnit, WrStandardChange, getDeliveryGoods, getDeliveryGoodsDetail, deliveryGoodsChange }
+}
+
+/**
+ * 价格信息
+ */
+export function handlePrice(formState: UnwrapRef<FormState>) {
     // 定价类型
     const priceType = [
         { key: 1, value: '一口价' },
         { key: 2, value: '点价' },
         { key: 3, value: '暂定价' },
     ];
-    // 业务类型
-    const businessType = [
-        { key: 1, value: '套保' },
-        { key: 2, value: '套利' },
-    ];
-    return { formState, contractType, priceType, businessType }
+    // 币种
+    const payCurrency = getItemEnum('paycurrency')
+    console.log('payCurrency', payCurrency);
+    // 目前写死,获取枚举信息里面没有 单位名称,后期进行优化
+    const payCurrencyUnit = ref<string>('元')
+    // 切换币种
+    function parCurrencyChange(value: number) {
+        const obj = payCurrency.find(e => e.enumdicid === value)
+        console.log('切换币种', obj);
+
+        // payCurrencyUnit.value = obj?.enumdicname
+    }
+    return { priceType, payCurrency, payCurrencyUnit, parCurrencyChange }
+}
+
+export function handleAddAction() {
+    function addAction() {
+        // orderContract()
+    }
+}
+
+/**
+ * 处理日期
+ */
+export function handleDate() {
+    const deliveryDate = ref<Moment[]>([])
+    function disabledDate(current: Moment) {
+        // Can not select days before today and today
+        return current && current < moment().endOf('day');
+    }
+    return { deliveryDate, disabledDate }
 }

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

@@ -188,7 +188,7 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {message, Modal} from "ant-design-vue";
-import {deleteOrderContract} from "@/views/information/spot-contract/components/setup";
+import { OrderContractControl} from "@/views/information/spot-contract/components/setup";
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -201,7 +201,7 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_cancel');
-        const {loading, orderContractState} = deleteOrderContract()
+        const {loading, orderContractState} = OrderContractControl()
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             loading.value = true;
@@ -210,8 +210,8 @@ export default defineComponent({
                 okText: '确认撤销',
                 cancelText: '取消',
                 onOk() {
-                    // 删除客户资料
-                    orderContractState(props.selectedRow.spotcontractid)
+                    // 撤销合同
+                    orderContractState(props.selectedRow.spotcontractid, 5)
                         .then(res => {
                             message.success(res);
                             // 通知上层  刷新数据

+ 39 - 22
src/views/information/spot-contract/components/check/index.vue

@@ -22,37 +22,37 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="合同编号">
-              <span class="white">NPCQ-2020121001</span>
+              <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="合同类型">
-              <span class="white">采购合同</span>
+              <span class="white">{{ getContractTypeName(selectedRow.contracttype) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="业务类型">
-              <span class="white">套保</span>
+              <span class="white">{{ getBizTypeName(selectedRow.biztype) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="采购方">
-                <span class="white">河北石家庄刚强矿石公司</span>
+                <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
             </a-form-item>
           </a-col>
       </a-row>
       <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="销售方">
-             <span class="white">菏泽已成钢材有限公司</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">查看附件</div>
+                    <div class="look">{{ formatValue(selectedRow.contracctstatus) }}</div>
                 </div>
             </a-form-item>
           </a-col>
@@ -60,7 +60,7 @@
         <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="状态">
-             <span class="green">正常</span>
+             <span class="green">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -70,31 +70,31 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="现货品种">
-              <span class="white">螺纹钢12</span>
+              <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="品类">
-              <span class="white">10mm</span>
+              <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">江铜</span>
+              <span class="white">{{ formatValue(selectedRow.brandname) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="标仓系数">
-                <span class="white">1.1</span>
+                <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
             </a-form-item>
           </a-col>
       </a-row>
       <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="商品规格">
-              <span class="white">符合国际GB/T1196-2008AL99.70规定,其中铝含量不低于99.7%</span>
+              <span class="white">{{ formatValue(selectedRow.spotgoodsdesc) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -104,36 +104,36 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="定价类型">
-              <span class="white">点价</span>
+              <span class="white">{{ getPriceTypeName(formatValue(selectedRow.pricetype)) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="数量">
-              <span class="white">菏泽已成钢材有限公司</span>
+              <span class="white">{{ formatValue(selectedRow.qty) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="点价合约">
-              <span class="white">CU2011</span>
+              <span class="white">{{ formatValue(selectedRow.goodscode) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="升贴水">
-              <span class="white">100元/吨</span>
+              <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="点价期">
-              <span class="white">2020-12-10~2021-02-10</span>
+              <span class="white">{{ formatValue(formatTime(selectedRow.startdate, "d") + '--' + formatTime(selectedRow.enddate, "d")) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="交收期">
-              <span class="white">2020-12-10~2021-02-10</span>
+              <span class="white">{{ formatValue(formatTime(selectedRow.deliverystartdate, "d") + '--' + formatTime(selectedRow.deliveryenddate, "d"))}}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -143,7 +143,7 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="保证金">
-              <span class="white">13700元</span>
+              <span class="white">{{ formatValue(selectedRow.contractmargin) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -194,7 +194,7 @@
       <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="备注">
-              <span class="white">符合国际GB/T1196-2008AL99.70规定,其中铝含量不低于99.7%</span>
+              <span class="white">{{ formatValue(selectedRow.remark) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -216,13 +216,26 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import {getBizTypeName, getContractTypeName} from "@/views/information/spot-contract/setup";
+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";
 
 export default defineComponent({
     name: 'spot-contract-detail',
     components: {},
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
     setup() {
         const { visible, cancel } = closeModal('spot_contract_btn_check');
         const loading = ref<boolean>(false);
@@ -242,6 +255,10 @@ export default defineComponent({
             maskClosableFlag,
             getContractTypeName,
             getBizTypeName,
+            formatValue,
+            getContractStatusName,
+            formatTime,
+            getPriceTypeName,
         };
     },
 });

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

@@ -188,7 +188,7 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {message, Modal} from "ant-design-vue";
-import {deleteOrderContract} from "@/views/information/spot-contract/components/setup";
+import {OrderContractControl} from "@/views/information/spot-contract/components/setup";
 
 export default defineComponent({
     name: 'delete-spot-contract',
@@ -201,7 +201,7 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_delete');
-        const {loading, orderContractState} = deleteOrderContract()
+        const {loading, orderContractState} = OrderContractControl()
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             loading.value = true;
@@ -211,7 +211,7 @@ export default defineComponent({
                 cancelText: '取消',
                 onOk() {
                     // 删除客户资料
-                    orderContractState(props.selectedRow.spotcontractid)
+                    orderContractState(props.selectedRow.spotcontractid, 1)
                         .then(res => {
                             message.success(res);
                             // 通知上层  刷新数据

+ 1 - 0
src/views/information/spot-contract/components/detail/index.vue

@@ -186,6 +186,7 @@ import {
     getPriceTypeName
 } from '@/views/information/spot-contract/setup';
 import { formatValue, formatTime } from '@/common/methods/format';
+import {v4 as uuidv4} from "uuid";
 
 export default defineComponent({
     name: 'spot-contract-detail',

+ 1 - 1
src/views/information/spot-contract/components/filterTable/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 过滤客户资料表格 -->
-  <div>
+  <div class="filterTable">
     <FilterOption :selectList="selectList"
                   :inputList="inputList"
                   :fixedBtnList="fixedBtnList" />

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

@@ -187,7 +187,7 @@ import {
     getPriceTypeName
 } from "@/views/information/spot-contract/setup";
 import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
-import {deleteOrderContract} from "@/views/information/spot-contract/components/setup";
+import { OrderContractControl} from "@/views/information/spot-contract/components/setup";
 import {message, Modal} from "ant-design-vue";
 
 export default defineComponent({
@@ -201,7 +201,7 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_finish');
-        const {loading, orderContractState} = deleteOrderContract()
+        const {loading, orderContractState} = OrderContractControl()
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             loading.value = true;
@@ -210,8 +210,8 @@ export default defineComponent({
                 okText: '确认完结',
                 cancelText: '取消',
                 onOk() {
-                    // 删除客户资料
-                    orderContractState(props.selectedRow.spotcontractid)
+                    // 完结合同
+                    orderContractState(props.selectedRow.spotcontractid, 6)
                         .then(res => {
                             message.success(res);
                             // 通知上层  刷新数据

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

@@ -1,32 +1,108 @@
-import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/interface";
-import {orderContract} from "@/services/proto/spotcontract";
-import {ref} from "vue";
-import {getSelectedAccountId} from "@/services/bus/account";
-
+import { orderContract, spotContractStatus } from "@/services/proto/spotcontract";
+import {
+    GldErmcpSpotContractOperateReq,
+    GldSpotContractInfo,
+    SpotContractOperateReq
+} from "@/services/proto/spotcontract/interface";
+import { ref } from "vue";
 
 /**
- * 删除未提交合同 // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
+ * 合同操作相关
  */
-export function deleteOrderContract(){
+export function changeOrderContract() {
     const loading = ref<boolean>(false);
 
-    function orderContractState(id: string): Promise<string>{
-        const reqs : GldErmcpSpotContractOperateReq = {
+    /**
+     * 合同操作
+     * @param id 合同id
+     * @param type 操作类型 1: 保存草稿  2: 提交申请 3: 删除成功 4:审核通过
+     * @param info 合同信息
+     */
+    function orderContractState(id: string, type: number, info?: GldSpotContractInfo): Promise<string> {
+        const reqs: GldErmcpSpotContractOperateReq = {
             SpotContractID: Number(id),
-            OperateType: 6,
+            OperateType: type,
             Remark: '',
+            Info: info,
+        }
+        let successText = "成功"
+        let errorText = "失败"
+
+        switch (type) {
+            case 1:
+                successText = "保存草稿成功"
+                errorText = "保存草稿失败:"
+                break;
+            case 2:
+                successText = "提交申请成功"
+                errorText = "提交申请失败:"
+                break;
+            case 3:
+                successText = "删除成功"
+                errorText = "删除失败:"
+                break;
+            case 4:
+                successText = "审核通过"
+                errorText = "审核失败:"
+                break;
         }
-       return orderContract(reqs)
+
+        return orderContract(reqs)
             .then(res => {
-                return Promise.reject("删除成功")
+                return Promise.resolve(successText)
             })
             .catch(err => {
-                return Promise.resolve("删除失败:" + err)
+                return Promise.reject(errorText + err)
             }).finally(() => {
-               loading.value = false
-           })
+                loading.value = false
+            })
     }
 
-    return {loading, orderContractState}
+    return { loading, orderContractState }
 }
 
+
+/**
+ * 修改合同类型
+ * 4:审核拒绝 6:正常完结 5:撤销
+ */
+export function OrderContractControl() {
+    const loading = ref<boolean>(false);
+
+    function orderContractState(id: string, type: number): Promise<string> {
+        const reqs: SpotContractOperateReq = {
+            SpotContractID: Number(id),
+            OperateType: type,
+            Remark: '',
+        }
+        let successText = "成功"
+        let errorText = "失败"
+
+        switch (type) {
+            case 4:
+                successText = "审核拒绝成功"
+                errorText = "审核拒绝失败:"
+                break;
+            case 5:
+                successText = "撤销成功"
+                errorText = "撤销失败:"
+                break;
+            case 6:
+                successText = "正常完结"
+                errorText = "合同完结失败:"
+                break;
+        }
+
+        return spotContractStatus(reqs)
+            .then(res => {
+                return Promise.resolve(successText)
+            })
+            .catch(err => {
+                return Promise.reject(errorText + err)
+            }).finally(() => {
+                loading.value = false
+            })
+    }
+
+    return { loading, orderContractState }
+}

+ 6 - 1
src/views/information/spot-contract/setup.ts

@@ -80,4 +80,9 @@ export function getContractTypeName(type: number): string{
             break;
     }
     return result
-}
+}
+
+
+/************** 接口相关提示 **************** /
+ *
+ */

+ 1 - 1
src/views/information/warehouse-info/compoments/filterTable/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 过滤仓库信息表格 -->
-  <div>
+  <div class="filterTable">
     <FilterOption :selectList="selectList"
                   :inputList="inputList"
                   :fixedBtnList="fixedBtnList" />