Prechádzať zdrojové kódy

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

huangbin 4 rokov pred
rodič
commit
21aead219f

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

@@ -114,4 +114,6 @@ export const funCode: Code = {
     ErmsMiddelGoodsEditReq: 1900677, // 套保品种修改请求
     ErmsMiddelGoodsEditRsp: 1900678, // 套保品种修改响应
 
+    //
+
 };

+ 36 - 2
src/services/go/ermcp/account/index.ts

@@ -3,10 +3,11 @@ import APP from "@/services";
 import { commonSearch_go } from "@/services/go";
 import {
     ErmcpBizGroupEx,
-    ErmcpBizGroupReq,
-    ErmcpLoginUserEx,
+    ErmcpBizGroupReq, ErmcpFuturesCompany,
+    ErmcpLoginUserEx, ErmcpRole, ErmcpRoleMenuEx,
     ErmcpTaAccountEx
 } from "@/services/go/ermcp/account/interface";
+import {getUserId} from "@/services/bus/account";
 
 /**
  * 查询业务类型分组(账户管理/账户设置) /Ermcp/QueryAccMgrBizGroupSet
@@ -43,4 +44,37 @@ export function QueryAccMgrLoginUser(querytype: number): Promise<ErmcpLoginUserE
     return commonSearch_go('/Ermcp/QueryAccMgrLoginUser', { userid, querytype }).catch((err) => {
         throw new Error(`查询账户管理登录账号: ${err.message}`);
     });
+}
+
+/**
+ * 查询期货公司(新增期货主账户时候查询的期货公司接口) /Ermcp/QueryFuturesCompany
+ * @constructor
+ */
+export function QueryFuturesCompany(): Promise<ErmcpFuturesCompany> {
+    return commonSearch_go('/Ermcp/QueryFuturesCompany', {}).catch((err) => {
+        throw new Error(`查询期货公司: ${err.message}`);
+    });
+}
+
+/**
+ * 查询账户管理角色详情(账户管理/角色设置/角色详情) /Ermcp/QueryAccMgrRoleMenu
+ * @param roleid  角色id(可多个,逗号隔开)
+ * @constructor
+ */
+export function QueryAccMgrRoleMenu(roleid: string): Promise<ErmcpRoleMenuEx> {
+    const userid = getUserId()
+    return commonSearch_go('/Ermcp/QueryAccMgrRoleMenu', {roleid, userid}).catch((err) => {
+        throw new Error(`查询账户管理角色详情: ${err.message}`);
+    });
+}
+
+/**
+ * 查询账户管理角色设置(账户管理/角色设置) /Ermcp/QueryAccMgrRole
+ * @constructor
+ */
+export function QueryAccMgrRole(): Promise<ErmcpRole> {
+    const userid = getUserId()
+    return commonSearch_go('/Ermcp/QueryAccMgrRole', {userid}).catch((err) => {
+        throw new Error(`查询账户管理角色设置: ${err.message}`);
+    });
 }

+ 59 - 0
src/services/go/ermcp/account/interface.ts

@@ -101,3 +101,62 @@ export interface ErmcpLoginUserEx{
     usertype	:number;//用户类型 - 1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户 7:企业成员(云平台)
 }
 
+/**
+ * 查询期货公司返回
+ */
+export interface ErmcpFuturesCompany{
+    brokerid        :string;//经纪公司代码
+    channeladdress  :string;//对冲渠道服务地址(多个地址用逗号分隔) – 192.168.30.10:3000,192.168.30.10:3001
+    channelid       :string;//对冲渠道ID
+    createtime      :string;//创建时间
+    creatorid       :string;//创建人
+    fcid    :number;//期货公司ID(SEQ_ERMCP_FUTURESCOMPANY)
+    fcname  :string;//期货公司名称
+    isvalid :number;//是否有效 - number;
+//:无效 1:有效
+    mhpaddress      :string;//MHP服务地址(IP:Port)
+    riskrulegroupid :string;//风控规则组ID
+    tradefeetmpid   :string;//手续费模板ID[TradeConfigTmpType为2]
+    trademargintmpid        :string;//保证金模板ID [TradeConfigTmpType为1]
+    traderatetmpid  :string;//汇率模板ID[TradeConfigTmpType为3]
+    updatetime      :string;//更新时间
+    updatorid       :string;//更新人
+}
+
+/**
+ * 账户管理角色详情
+ */
+export interface ErmcpRoleMenuEx{
+    menu: ErmcpRoleMenu[]
+}
+
+export interface ErmcpRoleMenu{
+    iconame	:string;//菜单图标
+    ishadrole	:boolean;//是否有权限
+    menutype	:number;//菜单类型 1:管理端 2:交易端 3:终端(企业云平台)
+    parentcode	:string;//上级资源代码
+    remark	:string;//菜单备注
+    resourcecode	:string;//菜单代码
+    resourcelevel	:number;//级别
+    resourcename	:string;//菜单名称
+    roleid	:number;//角色id
+    sort	:number;//排序
+    url	:string;//URL
+    userid	:number;//用户id
+}
+
+/**
+ * 查询账户管理角色设置
+ */
+export interface ErmcpRole{
+    areauserid	:number;//所属机构
+    autoid	:number;//角色ID(自增ID)
+    modifierid	:number;//修改人(创建人)
+    modifiername	:string;//修改人名称
+    modifytime	:string;//修改时间(创建时间)
+    rolename	:string;//角色名称
+    rolestatus	:number;//角色状态 - 1:启用 2:停用
+    roletype	:number;//角色类型 - 1- 管理端 2- 交易端
+}
+
+

+ 2 - 1
src/services/go/ermcp/customInfo/interface.ts

@@ -99,9 +99,10 @@ export interface AddUserInfoApplyReq {
     signedstatus?: number;//账户一号签签约状态
     signpdfurl?: string;//签约pdf文件
     subbranch?: string;//开户支行
+    taxpayernum?: string;  //纳税人识别号
     telphone?: string;//联系电话(加密存储)
     userid?: number;//用户ID(自增ID)
-
+    userinfotype?: number;   // 	   用户信息类型 - 1:个人 2:企业
     username?: string;//用户姓名
     userstate?: number;//开户状态 - 1:未提交 2: 待初审 3:初审拒绝 4:待复审 5:复审拒绝 6:测评不通过
     usertype?: number;//用户类型 - 1:投资者 2:机构

+ 53 - 0
src/services/go/ermcp/report/index.ts

@@ -0,0 +1,53 @@
+/***********************   报表相关 *********************/
+import {
+    AreaExpourseReportReq,
+    AreaSpotplReportReq, AreaStockReportReq, Ermcp3AreaSpotPLRsp, Ermcp3AreaStockReport,
+    Ermcp3ExpourseReportRsp, Ermcp3FinanceReport, FinanceReportReq
+} from "@/services/go/ermcp/report/interface";
+import {getUserId} from "@/services/bus/account";
+import APP from "@/services";
+import {commonSearch_go} from "@/services/go";
+
+/**
+ * 查询敞口报表 /Ermcp3/QryAreaExpourseReport
+ * @param req.userid
+ * @param req.querytype  查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细
+ */
+export function qryAreaExpourseReport(req: AreaExpourseReportReq): Promise<Ermcp3ExpourseReportRsp>{
+    req.userid = getUserId()
+    return commonSearch_go('/Ermcp3/QryAreaExpourseReport', req).catch((err) => {
+        throw new Error(`查询敞口报表: ${err.message}`);
+    });
+}
+
+/**
+ *  查询现货报表 /Ermcp3/QryAreaSpotplReport
+ */
+export function qryAreaSpotplReport(req: AreaSpotplReportReq): Promise<Ermcp3AreaSpotPLRsp>{
+    req.userid = getUserId()
+    return commonSearch_go('/Ermcp3/QryAreaSpotplReport', req).catch((err) => {
+        throw new Error(`查询现货报表: ${err.message}`);
+    });
+}
+
+/**
+ * 查询库存报表 /Ermcp3/QryAreaStockReport
+ * @param req
+ */
+export function qryAreaStockReport(req: AreaStockReportReq): Promise<Ermcp3AreaStockReport>{
+    req.userid = getUserId()
+    return commonSearch_go('/Ermcp3/QryAreaStockReport', req).catch((err) => {
+        throw new Error(`查询库存报表: ${err.message}`);
+    });
+}
+
+/**
+ * 查询财务报表 /Ermcp3/QryFinanceReport
+ * @param req
+ */
+export function qryFinanceReport(req: FinanceReportReq): Promise<Ermcp3FinanceReport>{
+    req.userid = getUserId()
+    return commonSearch_go('/Ermcp3/QryFinanceReport', req).catch((err) => {
+        throw new Error(`查询财务报表: ${err.message}`);
+    });
+}

+ 258 - 0
src/services/go/ermcp/report/interface.ts

@@ -0,0 +1,258 @@
+/**
+ * 敞口报表请求
+ */
+export interface AreaExpourseReportReq {
+    userid?: number,    // 用户ID
+    querytype: number,  // 查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细
+
+    tradedate?: string, // 交易日(格式yyyymmdd)
+    cycletype?: number, // 周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    cycletime?: string, // 周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
+    begindate?: string, // 开始交易日(格式yyyymmdd)
+    enddate?: string,   // 结束交易日(格式yyyymmdd)
+}
+
+/**
+ *  敞口报表 信息返回
+ */
+export interface Ermcp3ExpourseReportRsp{
+    accountid       :number;//期货账户ID (作废, 默认为number;
+//)
+    accountname     :string;//机构名称
+    arbitrageqty    :number;//套利量
+    areauserid      :number;//所属机构\交易用户ID
+    buyfutureqty    :number;//买入期货数量
+    buyplanqty      :number;//采购计划数量
+    buypricedqty    :number;//采购合同已定价数量
+    cycletime       :string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+//)【原值】
+    cycletype       :number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    diffexposure    :number;//变动量(套保敞口)
+    difffutuqty     :number;//变动量(期货)
+    diffhedgeqty    :number;//变动量(现货应套保总量)
+    diffmgqtya      :number;//套保变动量
+    diffmgqtyb      :number;//套利变动量
+    diffqty :number;//变动量(总敞口)
+    diffspotqty     :number;//变动量(现货)
+    enumdicname     :string;//单位名称
+    hedgeqty        :number;//套保量
+    mgneedhedgeratio        :number;//套保比例(套保品的)
+    middlegoodsid   :number;//套保品种ID
+    middlegoodsname :string;//套保商品名称
+    middlgoodscode  :string;//套保商品代码
+    needarbitrageqty        :number;//应套利量
+    needarbitrageratio      :number;//套利比例(套保品的)
+    needhedgeexposoure      :number;//应套保敞口(套保敞口)
+    needhedgeqty    :number;//应套保量
+    needhedgeratio  :number;//应套保敞口比例
+    oriarbitrageqty :number;//期初套利量
+    oribuyfutureqty :number;//期初买入期货数量
+    oribuyplanqty   :number;//期初采购计划数量
+    oribuypricedqty :number;//期初采购合同已定价数量
+    orihedgeqty     :number;//期初套保量
+    orineedarbitrageqty     :number;//期初应套利量
+    orineedhedgeexposoure   :number;//期初应套保敞口
+    orineedhedgeqty :number;//期初应套保量
+    orisellfutureqty        :number;//期初卖出期货数量
+    orisellplanqty  :number;//期初销售计划数量
+    orisellpricedqty        :number;//期初销售合同已定价数量
+    oritotalexposure        :number;//期初实时总敞口
+    oritotalfutureqty       :number;//期初期货头寸总量
+    oritotalneedhedgeqty    :number;//期初应套保总量
+    oritotalspotqty :number;//期初现货头寸总量
+    reckondate      :string;//日照时期(yyyyMMdd)
+    sellfutureqty   :number;//卖出期货数量
+    sellplanqty     :number;//销售计划数量
+    sellpricedqty   :number;//销售合同已定价数量
+    totalexposure   :number;//实时总敞口(总敞口)
+    totalfutureqty  :number;//期货头寸总量(期货总量)
+    totalhedgeratio :number;//敞口比例
+    totalneedhedgeqty       :number;//应套保总量(现货应套保总量)
+    totalspotqty    :number;//现货头寸总量
+    unitid  :number;//单位id
+    updatetime      :string;//更新时间
+}
+
+/**
+ * 查询现货报表
+ */
+export interface AreaSpotplReportReq{
+    userid?: number,  //       用户ID
+    querytype: number, //      查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细 5-周期报表明细
+    tradedate?: string,//      交易日(格式yyyymmdd)
+    cycletype?: number,//      周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    cycletime?: string,//      周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
+    begindate?: string,//      开始交易日(格式yyyymmdd)
+    enddate?: string,//        结束交易日(格式yyyymmdd)
+    deliverygoodsid?: number,//现货品种id
+    wrstandardid?: number,//   品类id
+    currencyid?: number,//     币种id
+}
+
+/**
+ * 查询现货报表返回
+ */
+export interface Ermcp3AreaSpotPLRsp{
+    accountid       :number;//期货账户ID (作废, 默认为number;
+//)
+    accountname     :string;//机构名称
+    actualpl        :number;//现货损益
+    areauserid      :number;//所属机构\交易用户ID
+    biztype :number;//业务类型 - 1:套保 2:套利
+    brandname       :string;//品牌名称
+    curamount       :number;//期末额
+    curaverageprice :number;//期末均价
+    curbuyamount    :number;//期末采购总额
+    curbuyqty       :number;//期末采购总量
+    curmarketvalue  :number;//参考市值(期末市值)
+    curqty  :number;//期末量
+    currencyid      :number;//结算币种ID【原值】
+    currencyname    :string;//币种名称
+    cursellamount   :number;//期末销售总额
+    cursellqty      :number;//期末销售总量
+    curspotprice    :number;//参考市价(最新价)
+    cycletime       :string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+//)【原值】
+    cycletype       :number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    deliverygoodscode       :string;//现货商品代码
+    deliverygoodsid :number;//现货品种ID
+    deliverygoodsname       :string;//现货商品名称
+    enumdicname     :string;//现货商品单位名称
+    floatpl :number;//浮动损益
+    goodsunitid     :number;//现货商品单位id
+    oriamount       :number;//期初额
+    oriaverageprice :number;//期初均价
+    oribuyamount    :number;//期初采购总额
+    oribuyqty       :number;//期初采购总量
+    oriqty  :number;//期初量
+    orisellamount   :number;//期初销售总额
+    orisellqty      :number;//期初销售总量
+    reckondate      :string;//日照时期(yyyyMMdd)
+    spotgoodsbrandid        :number;//现货品牌ID
+    todaybuyamount  :number;//今日采购额(今采购额)
+    todaybuyaverageprice    :number;//今日采购均价
+    todaybuyqty     :number;//今日采购量(今采购量)
+    todayinqty      :number;//今日入库量(今入库量)
+    todayoutqty     :number;//今日出库量(今出库量)
+    todaysellamount :number;//今日销售额(今销售额)
+    todaysellaverageprice   :number;//今日销售均价
+    todaysellqty    :number;//今日销售量(今销售量)
+    unitid  :number;//品类单位id
+    unitidname      :string;//品类单位名称
+    updatetime      :string;//更新时间
+    wrfactortypeid  :number;//仓单要素类型ID(212+Unix秒时间戳(1number;
+//位)+xxxxxx)
+    wrstandardcode  :string;//品类代码
+    wrstandardid    :number;//现货品类ID
+    wrstandardname  :string;//品类名称
+}
+
+/**
+ * 查询库存报表请求
+ */
+export interface AreaStockReportReq{
+    userid?: number //               用户ID
+    querytype: number //             查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细 5-周期报表明细
+    tradedate?: string //            交易日(格式yyyymmdd)
+    cycletype?: number//             周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    begindate?: string//             开始交易日(格式yyyymmdd)
+    enddate?: string //              结束交易日(格式yyyymmdd)
+    deliverygoodsid?: number//       现货商品ID
+    wrstandardid?: number//          品类ID
+    spotgoodsbrandid?: number //     品牌ID
+}
+
+/**
+ * 查询库存报表返回
+ */
+export interface Ermcp3AreaStockReport{
+    brandname	:string;//品牌名称
+    curstock	:number;//期末库存量
+    cycletime	:string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+//)【原值】
+    cycletype	:number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    deliverygoodscode	:string;//现货品种代码
+    deliverygoodsid	:number;//现货品种id
+    deliverygoodsname	:string;//现货品种名称
+    diffqty	:number;//库存变化量 = 期末 - 期初
+    enumdicname	:string;//单位名称
+    goodsunitid	:number;//现货单位id
+    oristock	:number;//期初库存量
+    reckondate	:string;//日照时期(yyyyMMdd)
+    spotgoodsbrandid	:number;//现货品牌ID
+    todaybuyinqty	:number;//今采购入库量
+    todayproduceinqty	:number;//今内部入库量
+    todayproduceoutqty	:number;//今内部出库量
+    todayselloutqty	:number;//今销售出库量
+    unbuyinqty	:number;//采购未入库量(数据库未找到相关字段?)
+    unitid	:number;//品类单位id
+    unselloutqty	:number;//销售未出库量(数据库未找到相关字段?)
+    updatetime	:string;//更新时间
+    userid	:number;//机构ID
+    username	:string;//机构名称
+    warehousecode	:string;//仓库代码
+    warehouseinfoid	:string;//仓库ID
+    warehousename	:string;//仓库名称
+    warehousetype	:number;//仓库类型 - 1 厂库 2 自有库 3 合作库
+    wrstandardcode	:string;//品类代码
+    wrstandardid	:number;//品类ID
+    wrstandardname	:string;//品类名称
+}
+
+/**
+ * 查询财务报表请求
+ */
+export interface FinanceReportReq{
+    userid: number //       用户ID
+    querytype: number //    查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细 5-周期报表明细
+    tradedate?: string//    交易日(格式yyyymmdd)
+    cycletype?: string//    周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    cycletime?: string//    周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
+    begindate?: string//    开始交易日(格式yyyymmdd)
+    enddate?: string//      结束交易日(格式yyyymmdd)
+    currencyid?: number//   币种id(日报表明细)
+}
+
+/**
+ * 财务报表回应
+ */
+export interface Ermcp3FinanceReport{
+    areauserid	:number;//所属机构\交易用户ID
+    biztype	:number;//业务类型 - 1:套保 2:套利
+    brandname	:string;//品牌名称
+    buypreinvoicedamount	:number;//采购预收票额(预收票额)
+    buyprepaidamount	:number;//采购预付款额(预付货款额)
+    buytodayinvoiceamount	:number;//采购今收票额(今收票额)
+    buytodayrefundamount	:number;//采购今收退款额(今收退款额)
+    buytodaysettleamount	:number;//采购今付款额(今付货款额)
+    buyuninvoicedamount	:number;//采购应收票额(应收票额)
+    buyunpaidamount	:number;//采购应付款额(应付货款额)
+    currencyid	:number;//结算币种ID
+    currencyname	:string;//币种名称
+    cycletime	:string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+//)【原值】
+    cycletype	:number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    deliverygoodscode	:string;//现货品种代码
+    deliverygoodsid	:number;//现货品种ID
+    deliverygoodsname	:string;//现货品种名称
+    reckondate	:string;//日照时期(yyyyMMdd)
+    sellpreinvoicedamount	:number;//销售预开票额(预开票额)
+    sellprepaidamount	:number;//销售预收款额(预收货款额)
+    selltodayinvoiceamount	:number;//销售今开票额(今开票额)
+    selltodayrefundamount	:number;//销售今付退款额(今付退款额)
+    selltodaysettleamount	:number;//销售今收款额(今收货款额)
+    selluninvoicedamount	:number;//销售应开票额(应开票额)
+    sellunpaidamount	:number;//销售应收款额(应收货款额)
+    spotgoodsbrandid	:number;//现货品牌ID
+    todaypaysum	:number;//今付款合计
+    todayreceivesum	:number;//今收款合计
+    updatetime	:string;//更新时间
+    wrfactortypeid	:number;//仓单要素类型ID(212+Unix秒时间戳(1number;
+//位)+xxxxxx)
+    wrstandardcode	:string;//品类代码
+    wrstandardid	:number;//现货商品ID
+    wrstandardname	:string;//品类名称
+}
+
+
+

+ 2 - 2
src/views/business/purchase/components/storage/index.vue

@@ -192,13 +192,13 @@ export default defineComponent({
             const wrapEl = unref(formRef);
             wrapEl.validate().then(() => {
                 const params: ERMCPAreaInOutStockApplyReq = {
-                    InOutType: 1, //  1:采购入库 2:销售出库 3:生产入库 4:生产出库
+                    InOutType: 5, //  5:采购入库 6:销售出库 7:生产入库 8:生产出库
                     WRStandardID: props.selectedRow.wrstandardid, //品类ID
                     SpotGoodsBrandID: formState.SpotGoodsBrandID || 0, //现货品牌ID(DGFactoryItem表的ID)
                     DeliveryGoodsID: props.selectedRow.deliverygoodsid, //现货商品ID
                     SpotContractID: Long.fromString(props.selectedRow.spotcontractid), //合同ID
                     WarehouseInfo: formState.WarehouseInfo || 0, // uint64 现货仓库ID
-                    Qty: formState.Qty || 0, // double 数量
+                    Qty: formState.Qty || 0, // double 数量t
                     ApplyRemark: '', // string 申请备注
                 };
                 // 入库

+ 169 - 0
src/views/information/account_info/compoments/add/index.vue

@@ -0,0 +1,169 @@
+<template>
+  <!-- 新增账户 -->
+  <a-modal class="commonModal add-account-info"
+           title="新增账户"
+           v-model:visible="visible"
+           @cancel="cancel"
+           centered
+           :maskClosable="false"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">完成</a-button>
+    </template>
+    <a-form class="inlineForm"
+            ref="formRef"
+            :model="formState"
+            :rules="rules">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="账户角色"
+                       name="userinfotype">
+            <a-checkbox-group class="commonCheckboxGroup" v-model:value="formState.warehousetype">
+              <a-row>
+                <a-col :span="12">
+                  <a-checkbox value="A">业务员</a-checkbox>
+                </a-col>
+                <a-col :span="12">
+                  <a-checkbox value="B">跟单员</a-checkbox>
+                </a-col>
+              </a-row>
+            </a-checkbox-group>
+          </a-form-item>
+        </a-col>
+          <a-col :span="12">
+            <a-form-item label="账户名称"
+                         name="customername">
+              <a-input class="dialogInput"
+                       v-model:value="formState.customername"
+                       style="width: 200px"
+                       placeholder="请输入账户名称" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="登录账号"
+                         name="nickname">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.nickname"
+                       placeholder="请输入登录账号" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="登录密码"
+                         name="cardtype">
+              <a-input-password class="dialogInput" 
+                      style="width: 200px" 
+                      v-model:value="formState.legalpersonname" 
+                      placeholder="请输入登录密码" />
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="手机号码"
+                         name="legalpersonname">
+              <a-input class="dialogInput"
+                       style="width: 200px"
+                       v-model:value="formState.legalpersonname"
+                       placeholder="请输入手机号码" />
+            </a-form-item>
+          </a-col>
+      </a-row>
+    </a-form>
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { closeModal } from '@/common/setup/modal/index';
+import { initData } from '@/common/methods/index';
+import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
+import { getCardType, initFormState, handleApply } from './setup';
+import { AllEnums } from '@/services/go/commonService/interface';
+import { FormState } from './interface';
+import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
+import {AddUserInfoApplyReq} from "@/services/go/ermcp/customInfo/interface";
+import {getUserId} from "@/services/bus/account";
+
+export default defineComponent({
+    name: 'add-custom',
+    components: {},
+    setup() {
+        // 控制关闭弹窗
+        const { visible, cancel } = closeModal('custom_info_btn_add');
+        // 证件类型
+        const cardTypeList = ref<AllEnums[]>(getCardType());
+        // 表单
+        const formRef = ref();
+        const formState: UnwrapRef<FormState> = reactive(initFormState());
+        const rules = {
+            userinfotype: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
+            customername: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
+            nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
+            cardtype: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
+        };
+        // 下单方法
+        const { loading, applyAction } = handleApply();
+        function isPersonal(): boolean {
+            return formState.userinfotype === '1';
+        }
+        function submit() {
+            formRef.value
+                .validate()
+                .then(() => {
+                    const param = toRaw(formState);
+
+                    const paramReq: AddUserInfoApplyReq = {
+                        customername: param.customername,   // 必填
+                        userid: 1,  // 写死 必填
+                        memberareaid: getUserId(),
+                        userinfotype: Number(param.userinfotype),
+                        username: param.customername,
+                        userstate: 1, // 1: 保存草稿 2: 新增
+
+                        // 以上必填
+                        cardtype: param.cardtype, // 证件类型
+                        cardnum: param.cardnum, // 证件号码
+                        nickname: param.nickname, // 昵称
+                        remark: param.remark, // 备注
+                        mobilephone: param.mobilephone, //  手机号码
+                        telphone: param.telphone, // 电话
+                        cardfrontphotourl: param.cardfrontphotourl, // 正面照片
+                        cardaddress: param.cardaddress,  // 证件地址
+                        cityid: param.cityid, //
+                        districtid: param.districtid, // 地区
+                        // countryid: param.,
+                        provinceid: param.provinceid, //省
+                        contactname: param.contactname,  // 联系人
+                        legalpersonname: param.legalpersonname,  // 法人姓名(企业)
+                        taxpayernum: param.taxpayernum, // 纳税人识别号
+                        email: param.email,  // email
+                    }
+                    applyAction(paramReq);
+                    console.log('values', formState);
+                })
+                .catch((error: ValidateErrorEntity<FormState>) => {
+                    console.log('error', error);
+                });
+        }
+        initData(() => {});
+        return {
+            formState,
+            rules,
+            formRef,
+            cardTypeList,
+            isPersonal,
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.add-account-info {
+}
+</style
+>;

+ 7 - 0
src/views/information/account_info/setup.ts

@@ -0,0 +1,7 @@
+// 更新用户状态 4:正常 6:注销(停用)
+import {ResultInfo} from "@/common/methods/request";
+
+export const addCustomInfoSign = new Map<number, ResultInfo>([
+    [2, ['新增客户资料成功', '新增客户资料失败:']],
+    [1, ['保存草稿成功', '保存草稿失败:']],
+])

+ 35 - 8
src/views/information/custom/compoments/add/index.vue

@@ -8,10 +8,14 @@
            :maskClosable="false"
            width="890px">
     <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">完成</a-button>
+        <a-button key="submit"
+                  class="cancelBtn"
+                  @click="submit(1)">保存草稿
+        </a-button>
+        <a-button key="submit"
+                  type="primary"
+                  :loading="loading"
+                  @click="submit(2)">提交审核</a-button>
     </template>
     <a-form class="inlineForm"
             ref="formRef"
@@ -280,6 +284,7 @@ import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interfac
 import { getAddress } from '@/services/go/adress';
 import {addUserInfo} from "@/views/information/custom/compoments/setup";
 import {AddUserInfoApplyReq} from "@/services/go/ermcp/customInfo/interface";
+import {getUserId} from "@/services/bus/account";
 
 export default defineComponent({
     name: 'add-custom',
@@ -287,28 +292,50 @@ export default defineComponent({
     setup(name, context) {
         // 控制关闭弹窗
         const { visible, cancel } = closeModal('custom_info_btn_add');
+        const loading = ref<boolean>(false);
         // 证件类型
         const cardTypeList = ref<AllEnums[]>(getCardType());
         // 表单
         const { formRef, formState, rules } = handleForm();
-        // 下单方法
-        const { loading, addCustomerInfo } = addUserInfo();
         // 地址
         const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
         function isPersonal(): boolean {
             return formState.userinfotype === '1';
         }
-        function submit() {
+        function submit(OperateType: 1 | 2) {
             formRef.value
                 .validate()
                 .then(() => {
                     const param = toRaw(formState);
 
                     const reqParam :AddUserInfoApplyReq = {
+                        customername: param.customername,   // 必填
+                        userid: 1,  // 写死 必填
+                        memberareaid: getUserId(),
+                        userinfotype: Number(param.userinfotype),
+                        username: param.customername,
+                        userstate: OperateType, // 1: 保存草稿 2: 新增
 
+                        // 以上必填
+                        cardtype: param.cardtype, // 证件类型
+                        cardnum: param.cardnum, // 证件号码
+                        nickname: param.nickname, // 昵称
+                        remark: param.remark, // 备注
+                        mobilephone: param.mobilephone, //  手机号码
+                        telphone: param.telphone, // 电话
+                        cardfrontphotourl: param.cardfrontphotourl, // 正面照片
+                        cardaddress: param.cardaddress,  // 证件地址
+                        cityid: param.cityid, //
+                        districtid: param.districtid, // 地区
+                        // countryid: param.,9
+                        provinceid: param.provinceid, //省
+                        contactname: param.contactname,  // 联系人
+                        legalpersonname: param.legalpersonname,  // 法人姓名(企业)
+                        taxpayernum: param.taxpayernum, // 纳税人识别号
+                        email: param.email,  // email
                     }
 
-                    addCustomerInfo(reqParam)
+                    addUserInfo(OperateType, reqParam, loading)
                         .then(res => {
                             cancel()
                             context.emit('refresh')

+ 46 - 6
src/views/information/custom/compoments/modify/index.vue

@@ -9,10 +9,14 @@
            @cancel="cancel"
            width="890px">
     <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">完成</a-button>
+        <a-button key="submit"
+                  class="cancelBtn"
+                  @click="submit(1)">保存草稿
+        </a-button>
+        <a-button key="submit"
+                  type="primary"
+                  :loading="loading"
+                  @click="submit(2)">提交审核</a-button>
     </template>
     <a-form class="inlineForm"
             :form="form"
@@ -191,6 +195,9 @@
 import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods/index';
+import {AddUserInfoApplyReq} from "@/services/go/ermcp/customInfo/interface";
+import {getUserId} from "@/services/bus/account";
+import {addUserInfo, modifyUserInfo} from "@/views/information/custom/compoments/setup";
 
 export default defineComponent({
     name: 'modify-custom',
@@ -200,14 +207,47 @@ export default defineComponent({
         //   type:
         // }
     },
-    setup() {
+    setup(name,context) {
         // const { visible, cancel } = closeModal('modifyCustomInfo');
         const { visible, cancel } = closeModal('custom_info_btn_modify');
 
         const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
-        function submit() {
+        function submit(OperateType: 1 | 2) {
             cancel();
+            const reqParam :AddUserInfoApplyReq = {
+                // customername: param.customername,   // 必填
+                // userid: 1,  // 写死 必填
+                // memberareaid: getUserId(),
+                // userinfotype: Number(param.userinfotype),
+                // username: param.customername,
+                // userstate: OperateType, // 1: 保存草稿 2: 新增
+                //
+                // // 以上必填
+                // cardtype: param.cardtype, // 证件类型
+                // cardnum: param.cardnum, // 证件号码
+                // nickname: param.nickname, // 昵称
+                // remark: param.remark, // 备注
+                // mobilephone: param.mobilephone, //  手机号码
+                // telphone: param.telphone, // 电话
+                // cardfrontphotourl: param.cardfrontphotourl, // 正面照片
+                // cardaddress: param.cardaddress,  // 证件地址
+                // cityid: param.cityid, //
+                // districtid: param.districtid, // 地区
+                // // countryid: param.,9
+                // provinceid: param.provinceid, //省
+                // contactname: param.contactname,  // 联系人
+                // legalpersonname: param.legalpersonname,  // 法人姓名(企业)
+                // taxpayernum: param.taxpayernum, // 纳税人识别号
+                // email: param.email,  // email
+            }
+
+            // modifyUserInfo(OperateType, reqParam, loading)
+            //     .then(res => {
+            //         cancel()
+            //         context.emit('refresh')
+            //     })
+
         }
         initData(() => {});
         return {

+ 23 - 23
src/views/information/custom/compoments/setup.ts

@@ -1,18 +1,20 @@
 import {
     QueryAddUserInfoApply,
     QueryDeleteUserInfoApply,
-    QueryModifyUserInfo,
+    QueryModifyUserInfo, QueryModifyUserInfoApply,
     UpdateUserAccountStatus
 } from "@/services/go/ermcp/customInfo";
-import {AddUserInfoApplyReq, ModifyUserInfoReq} from "@/services/go/ermcp/customInfo/interface";
+import {AddUserInfoApplyReq, ModifyUserInfoApplyReq, ModifyUserInfoReq} from "@/services/go/ermcp/customInfo/interface";
 import {userInfoCheck} from "@/services/proto/accountinfo";
 import {UserInfoCheckMangeReq} from "@/services/proto/accountinfo/interface";
 import {message} from 'ant-design-vue';
-import {ref} from "vue";
+import {Ref, ref} from "vue";
 import {BaseResponse} from "@/services/go";
-import {getRequestResultInfo} from "@/common/methods/request";
+import {commonResultInfo, getRequestResultInfo} from "@/common/methods/request";
 import {GldContractStateSign} from "@/views/information/spot-contract/setup";
-import {ModifyUserInfoSign} from "@/views/information/custom/setup";
+import {addCustomInfoSign, ChangeCustomInfoSign, ModifyUserInfoSign} from "@/views/information/custom/setup";
+import {deletePlanSign} from "@/views/business/plan/setup";
+import {oldHedgePlanReq} from "@/services/proto/hedgeplan";
 
 /**
  *  撤销客户资料 撤销后的数据会进入草稿(未提交)
@@ -107,24 +109,22 @@ export function deleteUserInfo() {
 
 /**
  * 新增用户申请
+ * @param type: 2新 增, type: 1保存草稿
  */
-export function addUserInfo(){
-    const loading = ref<boolean>(false);
-
-    function addCustomerInfo(userInfoApply: AddUserInfoApplyReq): Promise<string> {
-        loading.value = true
-        return QueryAddUserInfoApply(userInfoApply)
-            .then((res) => {
-                return Promise.resolve("新增成功")
-            })
-            .catch((err) => {
-                return Promise.reject("新增失败:" + err)
-            }).finally(() => {
-                loading.value = false
-            })
-    }
-
-    return {loading, addCustomerInfo}
+export function addUserInfo(type: number, userInfoApply: AddUserInfoApplyReq, loading: Ref<boolean>): Promise<string>{
+    loading.value = true;
+    const sign = getRequestResultInfo(addCustomInfoSign, type)  // 接口请求后的返回提示 这里统一进行管理
+    const result = QueryAddUserInfoApply(userInfoApply)
+    return commonResultInfo(result, sign, loading)
 }
 
-
+/**
+ * 修改用户申请
+ * @param type: 2新 增, type: 1保存草稿
+ */
+export function modifyUserInfo(type: number, userInfoApply: ModifyUserInfoApplyReq, loading: Ref<boolean>): Promise<string>{
+    loading.value = true;
+    const sign = getRequestResultInfo(ChangeCustomInfoSign, type)  // 接口请求后的返回提示 这里统一进行管理
+    const result = QueryModifyUserInfoApply(userInfoApply)
+    return commonResultInfo(result, sign, loading)
+}

+ 10 - 0
src/views/information/custom/setup.ts

@@ -37,3 +37,13 @@ export const ModifyUserInfoSign = new Map<number, ResultInfo>([
     [4, ['恢复成功', '恢复失败:']],
     [6, ['停用成功', '停用失败:']],
 ])
+
+export const addCustomInfoSign = new Map<number, ResultInfo>([
+    [2, ['新增客户资料成功', '新增客户资料失败:']],
+    [1, ['保存草稿成功', '保存草稿失败:']],
+])
+
+export const ChangeCustomInfoSign = new Map<number, ResultInfo>([
+    [1, ['修改客户资料草稿成功', '修改客户资料草稿失败:']],
+    [2, ['修改客户资料成功', '修改客户资料失败:']],
+])