Handy_Cao 3 years ago
parent
commit
593653910b

+ 147 - 128
public/proto/thj.proto

@@ -341,36 +341,36 @@ message t2bBankSignRsp {
 	optional MessageHead Header = 1; // 消息头
 	optional int32 RetCode = 2; // 返回码
 	optional string RetDesc = 3; // 描述信息
-		optional uint64 ExtOperatorID = 4; // 外部操作流水号
-		optional string AccountCode = 5; // 账户
-		optional string NetAddr = 6; // 网络地址(当这里有网址时,应自动跳转网页)
-		optional int32 Status = 7; // 状态(0成功,其他数值参考银行服务的错误码)
-		required string ExchTicket = 8; // 交易所流水号
-		optional string ExchId = 9; // 交易所编号
-		optional string TradeDate = 10; // 交易所业务日期
-		optional string CenterTicket = 11; // 中心流水号
-		optional string CenterErrCode = 12; // 返回码
-		optional string CenterErrMsg = 13; // 返回结果说明
-		optional string bankChildAcc = 14; // 银行账号
-		optional string bankChildAccName = 15; // 银行账户名
-		optional string BankId = 16; // 银行卡行号
-		optional string BankAccNum = 17; // 银行卡号
-		optional string BankAccName = 18; // 银行卡户名
+	optional uint64 ExtOperatorID = 4; // 外部操作流水号
+	optional string AccountCode = 5; // 账户
+	optional string NetAddr = 6; // 网络地址(当这里有网址时,应自动跳转网页)
+	optional int32 Status = 7; // 状态(0成功,其他数值参考银行服务的错误码)
+	required string ExchTicket = 8; // 交易所流水号
+	optional string ExchId = 9; // 交易所编号
+	optional string TradeDate = 10; // 交易所业务日期
+	optional string CenterTicket = 11; // 中心流水号
+	optional string CenterErrCode = 12; // 返回码
+	optional string CenterErrMsg = 13; // 返回结果说明
+	optional string bankChildAcc = 14; // 银行账号
+	optional string bankChildAccName = 15; // 银行账户名
+	optional string BankId = 16; // 银行卡行号
+	optional string BankAccNum = 17; // 银行卡号
+	optional string BankAccName = 18; // 银行卡户名
 }
 
 // 解约请求
 message t2bBankCancelSignReq {
 	optional MessageHead Header = 1;
-		required uint64 ExtOperatorID = 2; // 外部操作流水号
-		optional string ExchId = 3; // 交易所编号
-		required string AccountCode = 4; // 账户
-		required string CusBankID = 5; // 托管银行编号
-		required int32 IsForce = 6; // 是否强制
-		optional string Currency = 7; // 币种
-		optional string TradeDate = 8; // 交易所业务日期
-		optional string ExchTicket = 9; // 交易所流水号
-		optional string BankChildAcc = 10; // 银行子账号
-		optional string BankChildAccName = 11; // 银行子账号名
+	required uint64 ExtOperatorID = 2; // 外部操作流水号
+	optional string ExchId = 3; // 交易所编号
+	required string AccountCode = 4; // 账户
+	required string CusBankID = 5; // 托管银行编号
+	required int32 IsForce = 6; // 是否强制
+	optional string Currency = 7; // 币种
+	optional string TradeDate = 8; // 交易所业务日期
+	optional string ExchTicket = 9; // 交易所流水号
+	optional string BankChildAcc = 10; // 银行子账号
+	optional string BankChildAccName = 11; // 银行子账号名
 }
 
 // 解约应答
@@ -378,41 +378,41 @@ message t2bBankCancelSignRsp {
 	optional MessageHead Header = 1; // 消息头
 	optional int32 RetCode = 2; // 返回码
 	optional string RetDesc = 3; // 描述信息
-		optional uint64 ExtOperatorID = 4; // 外部操作流水号
-		optional string AccountCode = 5; // 账户
-		optional string NetAddr = 6; // 网络地址(当这里有网址时,应自动跳转网页)
-		optional int32 Status = 7; // 状态(0成功,其他数值参考银行服务的错误码)
-		required string ExchTicket = 8; // 交易所流水号
-		optional string ExchId = 9; // 交易所编号
-		optional string TradeDate = 10; // 交易所业务日期
-		optional string CenterTicket = 11; // 中心流水号
-		optional string CenterErrCode = 12; // 返回码
-		optional string CenterErrMsg = 13; // 返回结果说明
+	optional uint64 ExtOperatorID = 4; // 外部操作流水号
+	optional string AccountCode = 5; // 账户
+	optional string NetAddr = 6; // 网络地址(当这里有网址时,应自动跳转网页)
+	optional int32 Status = 7; // 状态(0成功,其他数值参考银行服务的错误码)
+	required string ExchTicket = 8; // 交易所流水号
+	optional string ExchId = 9; // 交易所编号
+	optional string TradeDate = 10; // 交易所业务日期
+	optional string CenterTicket = 11; // 中心流水号
+	optional string CenterErrCode = 12; // 返回码
+	optional string CenterErrMsg = 13; // 返回结果说明
 }
 
 // 出金请求
 message t2bBankWithdrawReq {
 	optional MessageHead Header = 1;
-		required uint64 ExtOperatorID = 2; // 外部操作流水号
-		optional string ExchId = 3; // 交易所编号
-		required string AccountCode = 4; // 资金账户
-		required string CusBankID = 5; // 托管银行编号
-		required string Currency = 6; // 币种
-		optional int32 AccountType = 7; // 账户类型
-		optional string BankChildAccount = 8; // 银行子账号
-		optional string BankChildAccountName = 9; // 银行子账号名
-		optional string OpenCardBankId = 10; // 银行卡行号
-		optional string BankAccoutNum = 11; // 银行卡号
-		optional string BankAccoutName = 12; // 银行卡户名
-		required double Amount = 13; // 出金金额
-		optional string AppDateTime = 14; // 申请日期和时间
-		optional string OldTaPWD = 15; // 资金密码
-		optional string Desc = 16; // 备注
-		optional string IdentifyCode = 17; // 验证码
-		optional string BranchBankName = 18; // 收款支行名称
-		optional string Extend_Info = 19; // 扩展信息(JSON串,参考配置要求进行填充)
-		optional string Remark = 20; // 备注
-		optional string ExchTicket = 21; // 交易所流水号
+	required uint64 ExtOperatorID = 2; // 外部操作流水号
+	optional string ExchId = 3; // 交易所编号
+	required string AccountCode = 4; // 资金账户
+	required string CusBankID = 5; // 托管银行编号
+	required string Currency = 6; // 币种
+	optional int32 AccountType = 7; // 账户类型
+	optional string BankChildAccount = 8; // 银行子账号
+	optional string BankChildAccountName = 9; // 银行子账号名
+	optional string OpenCardBankId = 10; // 银行卡行号
+	optional string BankAccoutNum = 11; // 银行卡号
+	optional string BankAccoutName = 12; // 银行卡户名
+	required double Amount = 13; // 出金金额
+	optional string AppDateTime = 14; // 申请日期和时间
+	optional string OldTaPWD = 15; // 资金密码
+	optional string Desc = 16; // 备注
+	optional string IdentifyCode = 17; // 验证码
+	optional string BranchBankName = 18; // 收款支行名称
+	optional string Extend_Info = 19; // 扩展信息(JSON串,参考配置要求进行填充)
+	optional string Remark = 20; // 备注
+	optional string ExchTicket = 21; // 交易所流水号
 }
 
 // 出金应答
@@ -420,38 +420,38 @@ message t2bBankWithdrawRsp {
 	optional MessageHead Header = 1; // 消息头
 	optional int32 RetCode = 2; // 返回码
 	optional string RetDesc = 3; // 描述信息
-		optional uint64 ExtOperatorID = 4; // 外部操作流水号
-		optional int32 Status = 5; // 状态(0成功,其他数值参考银行服务的错误码)
-		required string ExchTicket = 6; // 交易所流水号
-		optional string ExchId = 7; // 交易所编号
-		optional string TradeDate = 8; // 交易日
-		optional string CenterTicket = 9; // 中心流水号
-		optional string CenterErrCode = 10; // 中心返回码
-		optional string CenterErrMsg = 11; // 中心返回结果说明
-		optional string CerterCheckDate = 12; // 中心对账日期
-		optional string NetAddr = 13; // 网络地址(当这里有网址时,应自动跳转网页)
+	optional uint64 ExtOperatorID = 4; // 外部操作流水号
+	optional int32 Status = 5; // 状态(0成功,其他数值参考银行服务的错误码)
+	required string ExchTicket = 6; // 交易所流水号
+	optional string ExchId = 7; // 交易所编号
+	optional string TradeDate = 8; // 交易日
+	optional string CenterTicket = 9; // 中心流水号
+	optional string CenterErrCode = 10; // 中心返回码
+	optional string CenterErrMsg = 11; // 中心返回结果说明
+	optional string CerterCheckDate = 12; // 中心对账日期
+	optional string NetAddr = 13; // 网络地址(当这里有网址时,应自动跳转网页)
 }
 
 // 入金请求
 message t2bBankDepositReq {
 	optional MessageHead Header = 1;
-		required uint64 ExtOperatorID = 2; // 外部操作流水号
-		required string CusBankID = 3; // 托管银行编号
-		optional string ExchId = 4; // 交易所编号
-		optional string TradeDate = 5; // 交易日
-		optional string ExchTicket = 6; // 交易所流水号
-		required string AccountCode = 7; // 资金账户
-		optional string BusinessNo = 8; // 银行业务编号
-		optional string BankChildAccount = 9; // 银行子账号
-		optional string BankChildAccountName = 10; // 银行子账号名
-		optional string OldTaPWD = 11; // 资金密码
-		required double Amount = 12; // 金额
-		required string Currency = 13; // 币种
-		optional string Remark = 14; // 备注
-		optional string OpenCardBankId = 15; // 银行卡行号
-		optional string BankAccoutNum = 16; // 银行卡号
-		optional string BankAccoutName = 17; // 银行卡户名
-		optional string Extend_Info = 18; // 扩展信息(JSON串,参考配置要求进行填充)
+	required uint64 ExtOperatorID = 2; // 外部操作流水号
+	required string CusBankID = 3; // 托管银行编号
+	optional string ExchId = 4; // 交易所编号
+	optional string TradeDate = 5; // 交易日
+	optional string ExchTicket = 6; // 交易所流水号
+	required string AccountCode = 7; // 资金账户
+	optional string BusinessNo = 8; // 银行业务编号
+	optional string BankChildAccount = 9; // 银行子账号
+	optional string BankChildAccountName = 10; // 银行子账号名
+	optional string OldTaPWD = 11; // 资金密码
+	required double Amount = 12; // 金额
+	required string Currency = 13; // 币种
+	optional string Remark = 14; // 备注
+	optional string OpenCardBankId = 15; // 银行卡行号
+	optional string BankAccoutNum = 16; // 银行卡号
+	optional string BankAccoutName = 17; // 银行卡户名
+	optional string Extend_Info = 18; // 扩展信息(JSON串,参考配置要求进行填充)
 }
 
 // 入金应答
@@ -459,33 +459,33 @@ message t2bBankDepositRsp {
 	optional MessageHead Header = 1; // 消息头
 	optional int32 RetCode = 2; // 返回码
 	optional string RetDesc = 3; // 描述信息
-		optional uint64 ExtOperatorID = 4; // 外部操作流水号
-		optional int32 Status = 5; // 状态(0成功,其他数值参考银行服务的错误码)
-		required string ExchTicket = 6; // 交易所流水号
-		optional string ExchId = 7; // 交易所编号
-		optional string TradeDate = 8; // 交易日
-		optional string CenterTicket = 9; // 中心流水号
-		optional string CenterErrCode = 10; // 中心返回码
-		optional string CenterErrMsg = 11; // 中心返回结果说明
-		optional string CerterCheckDate = 12; // 中心对账日期
-		optional string NetAddr = 13; // 网络地址(当这里有网址时,应自动跳转网页)
+	optional uint64 ExtOperatorID = 4; // 外部操作流水号
+	optional int32 Status = 5; // 状态(0成功,其他数值参考银行服务的错误码)
+	required string ExchTicket = 6; // 交易所流水号
+	optional string ExchId = 7; // 交易所编号
+	optional string TradeDate = 8; // 交易日
+	optional string CenterTicket = 9; // 中心流水号
+	optional string CenterErrCode = 10; // 中心返回码
+	optional string CenterErrMsg = 11; // 中心返回结果说明
+	optional string CerterCheckDate = 12; // 中心对账日期
+	optional string NetAddr = 13; // 网络地址(当这里有网址时,应自动跳转网页)
 }
 
 // 铁合金现货预售摘牌接口请求
 message SpotPresaleDestingOrderReq {
 	optional MessageHead Header = 1;
-		optional uint32 UserID = 2; // 用户ID,必填
-		optional uint64 AccountID = 3; // 资金账号,必填
-		optional uint64 PresaleApplyID = 4; // 预售申请ID,必填
-		optional uint64 Qty = 5; // 预售数量,必填
-		optional uint64 DepositID = 6; // 定金方式,THJ_PresaleApplyDeposit表ID,必填
-		optional uint32 THJDeliveryMode = 7; // 交割方式,必填1:平台仓储2:自提
-		optional string ContactName = 8; // 联系人姓名,THJDeliveryMode=2,3时必填
-		optional string ContactInfo = 9; // 联系方式,THJDeliveryMode=2,3时必填
-		optional string DesAddress = 10; // 目的地地址,THJDeliveryMode=3时必填
-		optional string ReceiptInfo = 11; // 发票信息,THJDeliveryMode=2,3时必填
-		optional uint32 ClientType = 12; // 终端类型
-		optional string ClientSerialNo = 13; // 客户端流水号
+	optional uint32 UserID = 2; // 用户ID,必填
+	optional uint64 AccountID = 3; // 资金账号,必填
+	optional uint64 PresaleApplyID = 4; // 预售申请ID,必填
+	optional uint64 Qty = 5; // 预售数量,必填
+	optional uint64 DepositID = 6; // 定金方式,THJ_PresaleApplyDeposit表ID,必填
+	optional uint32 THJDeliveryMode = 7; // 交割方式,必填1:平台仓储2:自提
+	optional string ContactName = 8; // 联系人姓名,THJDeliveryMode=2,3时必填
+	optional string ContactInfo = 9; // 联系方式,THJDeliveryMode=2,3时必填
+	optional string DesAddress = 10; // 目的地地址,THJDeliveryMode=3时必填
+	optional string ReceiptInfo = 11; // 发票信息,THJDeliveryMode=2,3时必填
+	optional uint32 ClientType = 12; // 终端类型
+	optional string ClientSerialNo = 13; // 客户端流水号
 }
 
 // 铁合金现货预售摘牌接口应答
@@ -501,11 +501,11 @@ message SpotPresaleDestingOrderRsp {
 // 铁合金现货预售交收确认接口请求
 message SpotPresaleDeliveryConfirmReq {
 	optional MessageHead Header = 1;
-		optional uint32 UserID = 2; // 用户ID,必填
-		optional uint64 WRTradeDetailID = 3; // 采购成交单ID,必填
-		optional string Remark = 4; // 备注
-		optional uint32 ClientType = 5; // 终端类型
-		optional string ClientSerialNo = 6; // 客户端流水号
+	optional uint32 UserID = 2; // 用户ID,必填
+	optional uint64 WRTradeDetailID = 3; // 采购成交单ID,必填
+	optional string Remark = 4; // 备注
+	optional uint32 ClientType = 5; // 终端类型
+	optional string ClientSerialNo = 6; // 客户端流水号
 }
 
 // 铁合金现货预售交收确认接口应答
@@ -513,20 +513,20 @@ message SpotPresaleDeliveryConfirmRsp {
 	optional MessageHead Header = 1; // 消息头
 	optional int32 RetCode = 2; // 返回码
 	optional string RetDesc = 3; // 描述信息
-		optional uint32 UserID = 4; // 用户ID,必填
-		optional uint64 WRTradeDetailID = 5; // 采购成交单ID
-		optional string ClientSerialNo = 6; // 客户端流水号
+	optional uint32 UserID = 4; // 用户ID,必填
+	optional uint64 WRTradeDetailID = 5; // 采购成交单ID
+	optional string ClientSerialNo = 6; // 客户端流水号
 }
 
 // 铁合金现货预售违约确认接口请求
 message SpotPresaleBreachOfContractConfirmReq {
 	optional MessageHead Header = 1;
-		optional uint64 WRTradeDetailID = 2; // 采购成交单ID,必填
-		optional double BuyAmount = 3; // 买方应退费用,必填
-		optional double ExchangeAmount = 4; // 平台应收,必填
-		optional string HandleRemark = 5; // 处理备注
-		optional uint32 ClientType = 6; // 终端类型
-		optional string ClientSerialNo = 7; // 客户端流水号
+	optional uint64 WRTradeDetailID = 2; // 采购成交单ID,必填
+	optional double BuyAmount = 3; // 买方应退费用,必填
+	optional double ExchangeAmount = 4; // 平台应收,必填
+	optional string HandleRemark = 5; // 处理备注
+	optional uint32 ClientType = 6; // 终端类型
+	optional string ClientSerialNo = 7; // 客户端流水号
 }
 
 // 铁合金现货预售违约确认接口应答
@@ -534,17 +534,36 @@ message SpotPresaleBreachOfContractConfirmRsp {
 	optional MessageHead Header = 1; // 消息头
 	optional int32 RetCode = 2; // 返回码
 	optional string RetDesc = 3; // 描述信息
-		optional uint32 UserID = 4; // 用户ID,必填
-		optional uint64 WRTradeDetailID = 5; // 采购成交单ID
-		optional string ClientSerialNo = 6; // 客户端流水号
+	optional uint32 UserID = 4; // 用户ID,必填
+	optional uint64 WRTradeDetailID = 5; // 采购成交单ID
+	optional string ClientSerialNo = 6; // 客户端流水号
+}
+
+// 铁合金现货预售违约申请接口请求
+message SpotPresaleBreachOfContractApplyReq {
+	optional MessageHead Header = 1;
+	optional uint32 UserID = 2; // 用户ID,必填
+	optional uint64 WRTradeDetailID = 3; // 采购成交单ID,必填
+	optional uint32 ClientType = 4; // 终端类型
+	optional string ClientSerialNo = 5; // 客户端流水号
+}
+
+// 铁合金现货预售违约申请接口应答
+message SpotPresaleBreachOfContractApplyRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+	optional uint32 UserID = 4; // 用户ID,必填
+	optional uint64 WRTradeDetailID = 5; // 采购成交单ID
+	optional string ClientSerialNo = 6; // 客户端流水号
 }
 
 // 铁合金抽奖接口请求
 message THJRedPacketLotteryReq {
 	optional MessageHead Header = 1;
-		optional uint32 UserID = 2; // 用户ID,必填
-		optional uint32 ClientType = 3; // 终端类型
-		optional string ClientSerialNo = 4; // 客户端流水号
+	optional uint32 UserID = 2; // 用户ID,必填
+	optional uint32 ClientType = 3; // 终端类型
+	optional string ClientSerialNo = 4; // 客户端流水号
 }
 
 // 铁合金抽奖接口响应
@@ -552,10 +571,10 @@ message THJRedPacketLotteryRsp {
 	optional MessageHead Header = 1; // 消息头
 	optional int32 RetCode = 2; // 返回码
 	optional string RetDesc = 3; // 描述信息
-		optional uint32 UserID = 4; // 用户ID,必填
-		optional double RedPacketAmount = 5; // 中奖红包金额
-		optional uint32 GearLevel = 6; // 档位
-		optional string ClientSerialNo = 7; // 客户端流水号
+	optional uint32 UserID = 4; // 用户ID,必填
+	optional double RedPacketAmount = 5; // 中奖红包金额
+	optional uint32 GearLevel = 6; // 档位
+	optional string ClientSerialNo = 7; // 客户端流水号
 }
 
 // 账户资金信息请求 0 4 6

+ 9 - 6
src/business/goods/index.ts

@@ -100,9 +100,9 @@ export function useQueryTHJTradeDataList() {
     const loading = shallowRef(false)
     const { getUserId } = useLoginStore()
 
-    const getQueryTHJTradeDataList = (marketid: number) => {
+    const getQueryTHJTradeDataList = async (marketid: number) => {
         loading.value = true
-        return queryTHJTradeData({
+        await queryTHJTradeData({
             data: {
                 userid: getUserId(),
                 marketid: marketid,
@@ -117,6 +117,7 @@ export function useQueryTHJTradeDataList() {
                 loading.value = false
             }
         })
+        return dataList.value
     }
 
     return {
@@ -131,18 +132,18 @@ export function useQueryTHJTradeDataList() {
 }
 
 // 获取产品介绍列表
-// 关注标志 true-已关注 false-未关注
 export function useQueryTHJProductLists() {
     const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJProductRsp>()
     const loading = shallowRef(false)
     const { getUserId } = useLoginStore()
+    const active = shallowRef(0)
 
-    const getQueryTHJProductLists = (flag: boolean) => {
+    const getQueryTHJProductLists = async () => {
         loading.value = true
-        return queryTHJProduct({
+        await queryTHJProduct({
             data: {
                 userid: getUserId(),
-                favoriteflag: flag,
+                favoriteflag: active.value === 0,
                 page: pageIndex.value,
                 pagesize: pageSize.value,
             },
@@ -154,11 +155,13 @@ export function useQueryTHJProductLists() {
                 loading.value = false
             }
         })
+        return dataList.value
     }
 
     return {
         loading,
         dataList,
+        active,
         total,
         pageIndex,
         pageSize,

+ 9 - 6
src/business/order/index.ts

@@ -9,9 +9,9 @@ export function useQueryWrOrderDetail() {
     const loading = shallowRef(false)
     const { getUserId } = useLoginStore()
     
-    const getWrOrderDetail = (haswr: number, marketid?: number, bcancel?: number, wrtradetype?: number, begindate?: string, enddate?: string) => {
+    const getWrOrderDetail = async (haswr: number, marketid?: number, bcancel?: number, wrtradetype?: number, begindate?: string, enddate?: string) => {
         loading.value = true
-        return queryWrOrderDetail({
+        await queryWrOrderDetail({
             data: {
                 userid: getUserId(),
                 haswr: haswr,
@@ -31,6 +31,7 @@ export function useQueryWrOrderDetail() {
                 loading.value = false
             }
         })
+        return dataList.value
     }
 
     return {
@@ -50,9 +51,9 @@ export function useQueryWrTradeDetail() {
     const loading = shallowRef(false)
     const { getUserId } = useLoginStore()
     
-    const getWrTradeDetail = (haswr: number, marketid?: number, begindate?: string, enddate?: string) => {
+    const getWrTradeDetail = async (haswr: number, marketid?: number, begindate?: string, enddate?: string) => {
         loading.value = true
-        return queryWrTradeDetail({
+        await queryWrTradeDetail({
             data: {
                 userid: getUserId(),
                 haswr: haswr,
@@ -70,6 +71,7 @@ export function useQueryWrTradeDetail() {
                 loading.value = false
             }
         })
+        return dataList.value
     }
 
     return {
@@ -89,9 +91,9 @@ export function useTHJPurchaseTradeDetail() {
     const loading = shallowRef(false)
     const { getUserId } = useLoginStore()
     
-    const getTHJPurchaseTradeDetail = (type?: number) => {
+    const getTHJPurchaseTradeDetail = async (type?: number) => {
         loading.value = true
-        return queryTHJPurchaseTradeDetail({
+        await queryTHJPurchaseTradeDetail({
             data: {
                 userid: getUserId(),
                 type: type,
@@ -106,6 +108,7 @@ export function useTHJPurchaseTradeDetail() {
                 loading.value = false
             }
         })
+        return dataList.value
     }
 
     return {

+ 27 - 1
src/business/trade/index.ts

@@ -2,7 +2,7 @@ import { ref, shallowRef } from 'vue'
 import { v4 } from 'uuid'
 import { ClientType } from '@/constants/client'
 import { useLoginStore } from '@/stores'
-import { spotPresaleDestingOrder, spotPresaleDeliveryConfirm, spotPresaleBreachOfContractConfirm } from '@/services/api/trade'
+import { spotPresaleDestingOrder, spotPresaleDeliveryConfirm, spotPresaleBreachOfContractConfirm, spotPresaleBreachOfContractApply } from '@/services/api/trade'
 
 // 采购摘牌
 export function usePurchaseOrderDesting() {
@@ -88,4 +88,30 @@ export function useSpotPresaleBreachOfContractConfirm() {
         loading,
         breachSubmit,
     }
+}
+
+// 铁合金现货预售违约确认
+export function useSpotPresaleBreachOfContractApply() {
+    const loading = shallowRef(false)
+    const { getUserId } = useLoginStore()
+
+    const applySubmit = (id: number ) => {
+        loading.value = true
+        return spotPresaleBreachOfContractApply({
+            data: {
+                UserID: getUserId(),
+                WRTradeDetailID: id,
+                ClientSerialNo: v4(), // 客户端流水号
+                ClientType: ClientType.Web // 终端类型
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    return {
+        loading,
+        applySubmit,
+    }
 }

+ 3 - 0
src/constants/funcode.ts

@@ -54,6 +54,9 @@ export enum FunCode {
     SpotPresaleDestingOrderRsp = 1441850, // 铁合金现货预售摘牌接口应答
     SpotPresaleDeliveryConfirmReq = 1441861, // 铁合金现货预售交收确认接口请求
     SpotPresaleDeliveryConfirmRsp = 1441862, // 铁合金现货预售交收确认接口应答
+    SpotPresaleBreachOfContractApplyReq = 1441855,	/// 铁合金现货预售违约申请接口请求(0, 22, 63)
+	SpotPresaleBreachOfContractApplyRsp = 1441856,	/// 铁合金现货预售违约申请接口应答(0, 22, 64)
     SpotPresaleBreachOfContractConfirmReq = 1441857, // 铁合金现货预售违约确认接口请求
     SpotPresaleBreachOfContractConfirmRsp = 1441858, // 铁合金现货预售违约确认接口应答
+	
 }

+ 2 - 2
src/packages/mobile/views/mine/generalize/index.less

@@ -1,4 +1,5 @@
 .mine-generalize {
+
     &__header {
         background-color: #fff;
         margin-bottom   : .2rem;
@@ -49,7 +50,7 @@
     &__tabs {
         background-color: #fff;
     }
-
+    
     &__container {
         height: 100%;
         overflow-y: auto;
@@ -57,7 +58,6 @@
         .list {
             display: flex;
             align-items: center;
-            background-color: #fff;
 
             &-row {
                 font-size: .32rem;

+ 34 - 37
src/packages/mobile/views/mine/generalize/index.vue

@@ -3,8 +3,7 @@
         <template #header>
             <app-navbar title="我的推广" />
         </template>
-        <app-pull-refresh class="tradeData__container" v-model:pageIndex="pageIndex" :page-count="pageCount"
-            :updateList="dataList" @refresh="onRefresh" @updated="onRefreshUpdated">
+        <app-pull-refresh class="mine-generalize__container" :dataList="dataList" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
             <template #header>
                 <div class="mine-generalize__header">
                     <div class="info">
@@ -22,7 +21,7 @@
                         </div>
                     </div>
                 </div>
-                <Tabs class="mine-generalize__tabs">
+                <Tabs class="mine-generalize__tabs" @change="onClickTab">
                     <Tab title="交易数据">
                         <Empty v-if="dataList.length === 0" />
                     </Tab>
@@ -30,37 +29,23 @@
                         <Empty />
                     </Tab>
                 </Tabs>
-                <ul class="list list-row" v-if="showHeader">
-                    <li class="list-column">
-                        <span>日期</span>
-                    </li>
-                    <li class="list-column">
-                        <span>市场</span>
-                    </li>
-                    <li class="list-column">
-                        <span>商品</span>
-                    </li>
-                    <li class="list-column">
-                        <span>被推荐人</span>
-                    </li>
-                    <li class="list-column">
-                        <span>吨数</span>
-                    </li>
-                    <li class="list-column">
-                        <span>笔数</span>
-                    </li>
+                <ul class="list list-row" v-if="dataList.length != 0">
+                    <li class="list-column"><span>日期</span></li>
+                    <li class="list-column"><span>市场</span></li>
+                    <li class="list-column"><span>商品</span></li>
+                    <li class="list-column"><span>被推荐人</span></li>
+                    <li class="list-column"><span>吨数</span></li>
+                    <li class="list-column"><span>笔数</span></li>
                 </ul>
             </template>
             <template #default="{ item }">
                 <ul class="list list-row">
-                    <li class="list-column">
-                        <span>{{ formatDate(item.reckondate, 'YYYY-MM-DD') }}</span>
-                    </li>
-                    <li class="list-column">{{ item.marketid == 64201 ? '采购' : '供求' }}</li>
-                    <li class="list-column">{{ item.wrstandardname }}</li>
-                    <li class="list-column">{{ item.accountname }}</li>
-                    <li class="list-column">{{ item.marketid == 64201 ? item.buytradeqty : item.selltradeqty }}</li>
-                    <li class="list-column">{{ item.selltradelot }}</li>
+                    <li class="list-column"><span>{{ formatDate(item.reckondate, 'YYYY-MM-DD') }}</span></li>
+                    <li class="list-column"><span>{{ item.marketid == 64201 ? '采购' : '供求' }}</span></li>
+                    <li class="list-column"><span>{{ item.wrstandardname }}</span></li>
+                    <li class="list-column"><span>{{ item.accountname }}</span></li>
+                    <li class="list-column"><span>{{ item.marketid == 64201 ? item.buytradeqty : item.selltradeqty }}</span></li>
+                    <li class="list-column"><span>{{ item.selltradelot }}</span></li>
                 </ul>
             </template>
         </app-pull-refresh>
@@ -78,8 +63,10 @@ import AppQrcode from '@mobile/components/base/qrcode/index.vue'
 import { formatDate } from '@/filters'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
-const { dataList, pageIndex, pageCount, getQueryTHJTradeDataList } = useQueryTHJTradeDataList()
-const showHeader = shallowRef(false)
+const { pageIndex, pageCount, getQueryTHJTradeDataList } = useQueryTHJTradeDataList()
+const pullRefreshRef = shallowRef()
+const dataList = shallowRef<Model.THJTradeDataRsp[]>([])
+const error = shallowRef(false)
 
 const { getUserId } = useLoginStore()
 const showQRCode = shallowRef(false)
@@ -97,14 +84,24 @@ queryUserAccount({
     }
 })
 
-const onRefresh = (callback: () => void) => {
-    getQueryTHJTradeDataList(64201).finally(() => callback())
+// Tab触发
+const onClickTab = () => {
+  pullRefreshRef.value?.refresh()
 }
 
-const onRefreshUpdated = (data: Model.UserScoreLogRsp[]) => {
-    showHeader.value = data.length > 0
+const onRefresh = (finish: () => void) => {
+    /// 查询数据
+    getQueryTHJTradeDataList(64201).then((res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res)
+    }).catch(() => {
+        error.value = true
+    }).finally(() => {
+        finish()
+    })
 }
-
 </script>
 
 <style lang="less">

+ 19 - 5
src/packages/mobile/views/mine/order/components/purchasetrade/index.vue

@@ -1,7 +1,6 @@
 <template>
     <app-view class="purchase">
-        <app-pull-refresh class="purchase__container" v-model:pageIndex="pageIndex" :page-count="pageCount"
-            :updateList="dataList" @refresh="onRefresh">
+        <app-pull-refresh class="purchase__container" :dataList="dataList" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
             <template #header>
                 <ul class="list list-row">
                     <li class="list-column">
@@ -27,6 +26,7 @@
                     </li>
                     <Button round size="mini">更多</Button>
                 </ul>
+                <Empty v-if="dataList.length === 0" />
             </template>
             <template #default="{ item }">
                 <ul class="list list-row" @click="$router.push({name:'purchase-trade-detail', params: {item: JSON.stringify(item)}})">
@@ -45,13 +45,27 @@
 
 <script lang="ts" setup>
 
+import { shallowRef } from 'vue'
 import { useTHJPurchaseTradeDetail } from '@/business/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import { Button } from 'vant'
 
-const { dataList, pageIndex, pageCount, getTHJPurchaseTradeDetail } = useTHJPurchaseTradeDetail()
-const onRefresh = (callback: () => void) => {
-    getTHJPurchaseTradeDetail().finally(() => callback())
+const {  pageIndex, pageCount, getTHJPurchaseTradeDetail } = useTHJPurchaseTradeDetail()
+const error = shallowRef(false)
+const dataList = shallowRef<Model.THJPurchaseTradeDetailRsp[]>([])
+
+const onRefresh = (finish: () => void) => {
+    /// 查询未完成
+    getTHJPurchaseTradeDetail(0).then((res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res)
+    }).catch(() => {
+        error.value = true
+    }).finally(() => {
+        finish()
+    })
 }
 
 </script>

+ 6 - 7
src/packages/mobile/views/mine/order/purchasetradedetail/index.vue

@@ -73,7 +73,7 @@
                 <Button block round type="primary" v-if="detail?.orderstatus === 8">转让撤销</Button>
                 <Button block round type="primary" v-if="detail?.orderstatus === 5" @click="spotConfirmSubmit">确认交收</Button>
                 <div class="pay__buttonview">
-                    <Button block round type="primary" v-if="detail?.orderstatus === 3" @click="spotBreachSubmit">违约</Button>
+                    <Button block round type="primary" v-if="detail?.orderstatus === 3" @click="spotApplySubmit">违约</Button>
                     <Button block round type="primary" v-if="detail?.orderstatus === 3">支付</Button>
                 </div>
             </div>
@@ -88,13 +88,13 @@ import { useNavigation } from '@/hooks/navigation'
 import { fullloading, dialog } from '@/utils/vant'
 import { Empty, Button, Toast } from 'vant'
 import { handleNoneValue, formatDate } from "@/filters";
-import { useSpotPresaleBreachOfContractConfirm, useSpotPresaleDeliveryConfirm } from "@/business/trade";
+import { useSpotPresaleDeliveryConfirm, useSpotPresaleBreachOfContractApply } from "@/business/trade";
 
 const { route } = useNavigation()
 const item = route.params.item
 const detail = shallowRef<Model.THJPurchaseTradeDetailRsp>()
-const { breachSubmit } = useSpotPresaleBreachOfContractConfirm()
-const { confirmSubmit} = useSpotPresaleDeliveryConfirm()
+const { confirmSubmit } = useSpotPresaleDeliveryConfirm()
+const { applySubmit} = useSpotPresaleBreachOfContractApply()
 const { router } = useNavigation()
 
 if (item) {
@@ -119,13 +119,12 @@ const spotConfirmSubmit = () => {
     })
 }
 
-const spotBreachSubmit = () => {
+const spotApplySubmit = () => {
     dialog('确认要违约吗?', {
         showCancelButton: true
     }).then(() => {
         fullloading((hideLoading) => {
-            const {wrtradedetailid, lastamount, discountamount} = detail.value ?? {}
-            breachSubmit(lastamount, discountamount, wrtradedetailid).then(() => {
+            applySubmit(detail.value?.wrtradedetailid ?? 0).then(() => {
                 hideLoading()
                 dialog('违约提交成功,请耐心等待审核。').then(() => {
                     router.back()

+ 27 - 30
src/packages/mobile/views/product/index.vue

@@ -3,16 +3,16 @@
       <template #header>
         <app-navbar class="product__header" title="产品介绍" />
       </template>
-      <Tabs class="product__tabs" @click-tab="onClickTab">
-          <Tab title="已关注">
-              <Empty v-if="empty"/>
+      <Tabs class="product__tabs" v-model:active="active" @change="onClickTab">
+          <Tab title="已关注" :name="0">
+              <Empty v-if="dataList.length === 0"/>
           </Tab>
-          <Tab title="未关注">
-            <Empty v-if="empty"/>
+          <Tab title="未关注" :name="1">
+            <Empty v-if="dataList.length === 0"/>
           </Tab>
       </Tabs>
-      <app-pull-refresh class="product__container" v-model:error="error" v-model:pageIndex="pageIndex"
-        :page-count="pageCount" :updateList="dataList" @refresh="onRefresh" @updated="onUpdated">
+      <app-pull-refresh ref="pullRefreshRef" class="product__container" :dataList="dataList" v-model:error="error" v-model:pageIndex="pageIndex"
+        :page-count="pageCount" @refresh="onRefresh">
         <template #default="{ item }">
           <Cell>
             <template #title>
@@ -33,32 +33,29 @@
   import { useQueryTHJProductLists } from '@/business/goods'
   import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
   
-  const { dataList, pageIndex, pageCount, getQueryTHJProductLists } = useQueryTHJProductLists()
+  const { pageIndex, pageCount, getQueryTHJProductLists, active } = useQueryTHJProductLists()
+  const pullRefreshRef = shallowRef()
+  const dataList = shallowRef<Model.THJProductRsp[]>([])
   const error = shallowRef(false)
-  const empty = shallowRef(false)
-  /// tab激活项
-  const active = ref(0);
 
-  /// Tab触发
-  const onClickTab = (e) => {
-    active.value = e.name
-    /// 重新查询数据
-    getQueryTHJProductLists(e.name === 0).catch(() => {
-      error.value = true
-    })
-  }
+  // Tab触发
+const onClickTab = () => {
+  pullRefreshRef.value?.refresh()
+}
   
-  /// 下拉刷新
-  const onRefresh = (callback: () => void) => {
-    /// 查询数据
-    getQueryTHJProductLists(active.value === 0).catch(() => {
-      error.value = true
-    }).finally(() => callback())
-  }
-
-  const onUpdated=(lists: Model.THJProductRsp[])=>{
-    empty.value = lists.length===0
-  }
+const onRefresh = (finish: () => void) => {
+  /// 获取产品列表
+  getQueryTHJProductLists().then((res) => {
+    if (pageIndex.value === 1) {
+      dataList.value = []
+    }
+    dataList.value.push(...res)
+  }).catch(() => {
+    error.value = true
+  }).finally(() => {
+    finish()
+  })
+}
 
   </script>
 

+ 7 - 0
src/services/api/trade/index.ts

@@ -21,4 +21,11 @@ export function spotPresaleDeliveryConfirm(params: TradeParams<Proto.SpotPresale
  */
 export function spotPresaleBreachOfContractConfirm(params: TradeParams<Proto.SpotPresaleBreachOfContractConfirmReq, Proto.SpotPresaleBreachOfContractConfirmRsp>) {
     return tradeServerRequest('SpotPresaleBreachOfContractConfirmReq', 'SpotPresaleBreachOfContractConfirmRsp', params);
+}
+
+/**
+ * 铁合金现货预售违约申请接口请求
+ */
+ export function spotPresaleBreachOfContractApply(params: TradeParams<Proto.SpotPresaleBreachOfContractApplyReq, Proto.SpotPresaleBreachOfContractApplyRsp>) {
+    return tradeServerRequest('SpotPresaleBreachOfContractApplyReq', 'SpotPresaleBreachOfContractApplyRsp', params);
 }

+ 1 - 4
src/types/proto/trade.d.ts

@@ -76,13 +76,10 @@ declare global {
             Header?: IMessageHead;
             UserID: number; // 用户ID,必填
             WRTradeDetailID: number; // 采购成交单ID,必填
-            BuyAmount: number; // 买方应退费用,必填
-            ExchangeAmount: number; // 平台应收,必填
-            ApplyRemark?: string; // 申请备注
             ClientType: number; // 终端类型
             ClientSerialNo: string; // 客户端流水号
         }
-        
+
         // 铁合金现货预售违约申请接口应答
         interface SpotPresaleBreachOfContractApplyRsp {
             Header?: IMessageHead;