|
@@ -1,7 +1,7 @@
|
|
|
import { reactive, ref, shallowRef, computed } from 'vue'
|
|
import { reactive, ref, shallowRef, computed } from 'vue'
|
|
|
import { v4 } from 'uuid'
|
|
import { v4 } from 'uuid'
|
|
|
import { ClientType, OrderSrc } from '@/constants/client'
|
|
import { ClientType, OrderSrc } from '@/constants/client'
|
|
|
-import { useLoginStore } from '@/stores'
|
|
|
|
|
|
|
+import { loginStore } from '@/stores'
|
|
|
import {
|
|
import {
|
|
|
spotPresaleDestingOrder,
|
|
spotPresaleDestingOrder,
|
|
|
spotPresaleTransferCancel,
|
|
spotPresaleTransferCancel,
|
|
@@ -20,14 +20,15 @@ import { formatDate } from "@/filters";
|
|
|
import Long from 'long'
|
|
import Long from 'long'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
|
|
|
|
|
|
|
+const { loginId, userId, firstAccountId } = loginStore.$mapGetters()
|
|
|
|
|
+
|
|
|
// 采购摘牌
|
|
// 采购摘牌
|
|
|
export function usePurchaseOrderDesting() {
|
|
export function usePurchaseOrderDesting() {
|
|
|
- const { getUserId, getFirstAccountId } = useLoginStore()
|
|
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
|
|
|
|
|
const formData = ref<Partial<Proto.SpotPresaleDestingOrderReq>>({
|
|
const formData = ref<Partial<Proto.SpotPresaleDestingOrderReq>>({
|
|
|
- UserID: getUserId(), // 用户ID,必填
|
|
|
|
|
- AccountID: getFirstAccountId(), // 资金账号,必填
|
|
|
|
|
|
|
+ UserID: userId.value, // 用户ID,必填
|
|
|
|
|
+ AccountID: firstAccountId.value, // 资金账号,必填
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -54,14 +55,13 @@ export function usePurchaseOrderDesting() {
|
|
|
|
|
|
|
|
// 铁合金现货预售交收确认
|
|
// 铁合金现货预售交收确认
|
|
|
export function useSpotPresaleDeliveryConfirm() {
|
|
export function useSpotPresaleDeliveryConfirm() {
|
|
|
- const { getUserId } = useLoginStore()
|
|
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
|
|
|
|
|
const confirmSubmit = (id: string) => {
|
|
const confirmSubmit = (id: string) => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return spotPresaleDeliveryConfirm({
|
|
return spotPresaleDeliveryConfirm({
|
|
|
data: {
|
|
data: {
|
|
|
- UserID: getUserId(),
|
|
|
|
|
|
|
+ UserID: userId.value,
|
|
|
Remark: '',
|
|
Remark: '',
|
|
|
WRTradeDetailID: Long.fromString(id),
|
|
WRTradeDetailID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
@@ -82,13 +82,12 @@ export function useSpotPresaleDeliveryConfirm() {
|
|
|
// 铁合金现货预售违约申请
|
|
// 铁合金现货预售违约申请
|
|
|
export function useSpotPresaleBreachOfContractApply() {
|
|
export function useSpotPresaleBreachOfContractApply() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const applySubmit = (id: string) => {
|
|
const applySubmit = (id: string) => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return spotPresaleBreachOfContractApply({
|
|
return spotPresaleBreachOfContractApply({
|
|
|
data: {
|
|
data: {
|
|
|
- UserID: getUserId(),
|
|
|
|
|
|
|
+ UserID: userId.value,
|
|
|
WRTradeDetailID: Long.fromString(id),
|
|
WRTradeDetailID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
ClientType: ClientType.Web // 终端类型
|
|
@@ -108,10 +107,9 @@ export function useSpotPresaleBreachOfContractApply() {
|
|
|
// 铁合金现货预售付款处理接口
|
|
// 铁合金现货预售付款处理接口
|
|
|
export function useSpotPresalePlayment() {
|
|
export function useSpotPresalePlayment() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const formData = reactive<Partial<Proto.SpotPresalePlaymentReq>>({
|
|
const formData = reactive<Partial<Proto.SpotPresalePlaymentReq>>({
|
|
|
- UserID: getUserId(), // 用户ID,必填
|
|
|
|
|
|
|
+ UserID: userId.value, // 用户ID,必填
|
|
|
ClientType: ClientType.Web, // 终端类型
|
|
ClientType: ClientType.Web, // 终端类型
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
})
|
|
})
|
|
@@ -138,10 +136,9 @@ export function useSpotPresalePlayment() {
|
|
|
// 铁合金现货预售转让挂牌接口
|
|
// 铁合金现货预售转让挂牌接口
|
|
|
export function useSpotPresaleTransferListing() {
|
|
export function useSpotPresaleTransferListing() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const formData = reactive<Partial<Proto.SpotPresaleTransferListingReq>>({
|
|
const formData = reactive<Partial<Proto.SpotPresaleTransferListingReq>>({
|
|
|
- UserID: getUserId(), // 用户ID,必填
|
|
|
|
|
|
|
+ UserID: userId.value, // 用户ID,必填
|
|
|
ClientType: ClientType.Web, // 终端类型
|
|
ClientType: ClientType.Web, // 终端类型
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
})
|
|
})
|
|
@@ -173,13 +170,12 @@ export function useSpotPresaleTransferListing() {
|
|
|
// 铁合金现货预售转让撤销接口请求
|
|
// 铁合金现货预售转让撤销接口请求
|
|
|
export function useSpotPresaleTransferCancel() {
|
|
export function useSpotPresaleTransferCancel() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const transferCancelSubmit = (wrtradedetailid?: string) => {
|
|
const transferCancelSubmit = (wrtradedetailid?: string) => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return spotPresaleTransferCancel({
|
|
return spotPresaleTransferCancel({
|
|
|
data: {
|
|
data: {
|
|
|
- UserID: getUserId(),
|
|
|
|
|
|
|
+ UserID: userId.value,
|
|
|
WRTradeDetailID: Long.fromString(wrtradedetailid ?? '0'),
|
|
WRTradeDetailID: Long.fromString(wrtradedetailid ?? '0'),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
ClientType: ClientType.Web // 终端类型
|
|
@@ -199,11 +195,10 @@ export function useSpotPresaleTransferCancel() {
|
|
|
// 铁合金现货预售转让摘牌接口请求
|
|
// 铁合金现货预售转让摘牌接口请求
|
|
|
export function useSpotPresaleTransferDesting() {
|
|
export function useSpotPresaleTransferDesting() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId, getFirstAccountId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const formData = reactive<Proto.SpotPresaleTransferDestingReq>({
|
|
const formData = reactive<Proto.SpotPresaleTransferDestingReq>({
|
|
|
- UserID: getUserId(),
|
|
|
|
|
- AccountID: getFirstAccountId(),
|
|
|
|
|
|
|
+ UserID: userId.value,
|
|
|
|
|
+ AccountID: firstAccountId.value,
|
|
|
TransferID: Long.fromNumber(0),
|
|
TransferID: Long.fromNumber(0),
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
})
|
|
})
|
|
@@ -231,15 +226,14 @@ export function useSpotPresaleTransferDesting() {
|
|
|
// 挂牌撤单请求接口
|
|
// 挂牌撤单请求接口
|
|
|
export function useWrListingCancelOrder() {
|
|
export function useWrListingCancelOrder() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId, getFirstAccountId, getLoginId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const cancelSubmit = (id: string, buyorsell: number) => {
|
|
const cancelSubmit = (id: string, buyorsell: number) => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return wrListingCancelOrder({
|
|
return wrListingCancelOrder({
|
|
|
data: {
|
|
data: {
|
|
|
- UserID: getUserId(),
|
|
|
|
|
- AccountID: getFirstAccountId(),
|
|
|
|
|
- OperatorID: getLoginId(),
|
|
|
|
|
|
|
+ UserID: userId.value,
|
|
|
|
|
+ AccountID: firstAccountId.value,
|
|
|
|
|
+ OperatorID: loginId.value,
|
|
|
OrderSrc: OrderSrc.ORDERSRC_CLIENT,
|
|
OrderSrc: OrderSrc.ORDERSRC_CLIENT,
|
|
|
OldWRTradeOrderID: Long.fromString(id),
|
|
OldWRTradeOrderID: Long.fromString(id),
|
|
|
ClientOrderTime: formatDate(new Date().toString(), 'YYYY-MM-DD HH:mm:ss'),
|
|
ClientOrderTime: formatDate(new Date().toString(), 'YYYY-MM-DD HH:mm:ss'),
|
|
@@ -262,15 +256,14 @@ export function useWrListingCancelOrder() {
|
|
|
// 仓单明细提货请求接口
|
|
// 仓单明细提货请求接口
|
|
|
export function useWrOutInApply(holdlb?: Model.HoldLBRsp) {
|
|
export function useWrOutInApply(holdlb?: Model.HoldLBRsp) {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId, getFirstAccountId, getLoginId } = useLoginStore()
|
|
|
|
|
const orderQty = shallowRef(0.0)
|
|
const orderQty = shallowRef(0.0)
|
|
|
const checked = shallowRef(3)
|
|
const checked = shallowRef(3)
|
|
|
|
|
|
|
|
const formData = reactive<Partial<Proto.WROutApplyReq>>({
|
|
const formData = reactive<Partial<Proto.WROutApplyReq>>({
|
|
|
AppointmentRemark: '',
|
|
AppointmentRemark: '',
|
|
|
- UserID: getUserId(), // 用户ID,必填
|
|
|
|
|
- AccountID: getFirstAccountId(), // 申请人账户ID
|
|
|
|
|
- CreatorID: getLoginId(), // 创建人ID
|
|
|
|
|
|
|
+ UserID: userId.value, // 用户ID,必填
|
|
|
|
|
+ AccountID: firstAccountId.value, // 申请人账户ID
|
|
|
|
|
+ CreatorID: loginId.value, // 创建人ID
|
|
|
WRStandardID: holdlb?.wrstandardid,
|
|
WRStandardID: holdlb?.wrstandardid,
|
|
|
WarehouseID: holdlb?.warehouseid,
|
|
WarehouseID: holdlb?.warehouseid,
|
|
|
ClientSerialID: new Date().getTime(), // 客户端流水号
|
|
ClientSerialID: new Date().getTime(), // 客户端流水号
|
|
@@ -308,20 +301,19 @@ export function useWrOutInApply(holdlb?: Model.HoldLBRsp) {
|
|
|
// 仓单明细挂牌请求接口
|
|
// 仓单明细挂牌请求接口
|
|
|
export function useHdWROrder() {
|
|
export function useHdWROrder() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId, getFirstAccountId, getLoginId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const formData = reactive<Proto.HdWROrderReq>({
|
|
const formData = reactive<Proto.HdWROrderReq>({
|
|
|
Header: {
|
|
Header: {
|
|
|
- AccountID: getFirstAccountId(),
|
|
|
|
|
|
|
+ AccountID: firstAccountId.value,
|
|
|
},
|
|
},
|
|
|
IsSpecified: 0,
|
|
IsSpecified: 0,
|
|
|
PriceFactor: 1.0,
|
|
PriceFactor: 1.0,
|
|
|
FirstRatio: 0.0,
|
|
FirstRatio: 0.0,
|
|
|
CanBargain: 0,
|
|
CanBargain: 0,
|
|
|
CanPart: 1,
|
|
CanPart: 1,
|
|
|
- UserID: getUserId(),
|
|
|
|
|
- AccountID: getFirstAccountId(),
|
|
|
|
|
- OperatorID: getLoginId(),
|
|
|
|
|
|
|
+ UserID: userId.value,
|
|
|
|
|
+ AccountID: firstAccountId.value,
|
|
|
|
|
+ OperatorID: loginId.value,
|
|
|
ClientType: ClientType.Web,
|
|
ClientType: ClientType.Web,
|
|
|
BuyOrSell: BuyOrSell.Sell,
|
|
BuyOrSell: BuyOrSell.Sell,
|
|
|
WRPriceType: 1,
|
|
WRPriceType: 1,
|
|
@@ -363,19 +355,18 @@ export function useHdWROrder() {
|
|
|
// 仓单摘牌
|
|
// 仓单摘牌
|
|
|
export function useHdWRDealOrder() {
|
|
export function useHdWRDealOrder() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId, getFirstAccountId, getLoginId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const formData = reactive<Proto.HdWRDealOrderReq>({
|
|
const formData = reactive<Proto.HdWRDealOrderReq>({
|
|
|
- UserID: getUserId(), // 用户ID
|
|
|
|
|
- AccountID: getFirstAccountId(), // 资金账号
|
|
|
|
|
|
|
+ UserID: userId.value, // 用户ID
|
|
|
|
|
+ AccountID: firstAccountId.value, // 资金账号
|
|
|
RelatedWRTradeOrderID: Long.fromNumber(0), // 关联委托单号(摘牌委托关联挂牌委托单ID)
|
|
RelatedWRTradeOrderID: Long.fromNumber(0), // 关联委托单号(摘牌委托关联挂牌委托单ID)
|
|
|
- WRTransferUserID: getUserId(), // 仓单受让用户
|
|
|
|
|
|
|
+ WRTransferUserID: userId.value, // 仓单受让用户
|
|
|
OrderQty: 0, // 委托数量
|
|
OrderQty: 0, // 委托数量
|
|
|
OrderSrc: OrderSrc.ORDERSRC_CLIENT, // 委托来源
|
|
OrderSrc: OrderSrc.ORDERSRC_CLIENT, // 委托来源
|
|
|
ClientSerialNo: '', // 客户端流水号
|
|
ClientSerialNo: '', // 客户端流水号
|
|
|
ClientOrderTime: '', // 客户端委托时间
|
|
ClientOrderTime: '', // 客户端委托时间
|
|
|
ClientType: ClientType.Web, // 终端类型
|
|
ClientType: ClientType.Web, // 终端类型
|
|
|
- OperatorID: getLoginId(), // 操作员账号ID
|
|
|
|
|
|
|
+ OperatorID: loginId.value, // 操作员账号ID
|
|
|
TradeDate: '', // 交易日
|
|
TradeDate: '', // 交易日
|
|
|
HasWr: 1, // 是否有仓单-0:没有仓单1:有仓单
|
|
HasWr: 1, // 是否有仓单-0:没有仓单1:有仓单
|
|
|
IsFinancing: 0, // 是否融资购买(买摘牌时有效)-0:否1:是
|
|
IsFinancing: 0, // 是否融资购买(买摘牌时有效)-0:否1:是
|
|
@@ -407,12 +398,11 @@ export function useHdWRDealOrder() {
|
|
|
// 铁合金收益支取申请接口
|
|
// 铁合金收益支取申请接口
|
|
|
export function useTHJProfitDrawApplyReq() {
|
|
export function useTHJProfitDrawApplyReq() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
- const { getUserId, getLoginId } = useLoginStore()
|
|
|
|
|
|
|
|
|
|
const formData = reactive<Proto.THJProfitDrawApplyReq>({
|
|
const formData = reactive<Proto.THJProfitDrawApplyReq>({
|
|
|
- UserID: getUserId(), // 用户ID
|
|
|
|
|
|
|
+ UserID: userId.value, // 用户ID
|
|
|
ApplySrc: ClientType.Web,
|
|
ApplySrc: ClientType.Web,
|
|
|
- ApplyerID: getLoginId(),
|
|
|
|
|
|
|
+ ApplyerID: loginId.value,
|
|
|
ClientType: ClientType.Web
|
|
ClientType: ClientType.Web
|
|
|
})
|
|
})
|
|
|
|
|
|