|
@@ -10,6 +10,7 @@ import {
|
|
|
spotPresalePlayment,
|
|
spotPresalePlayment,
|
|
|
wrListingCancelOrder,
|
|
wrListingCancelOrder,
|
|
|
spotPresaleDeliveryConfirm,
|
|
spotPresaleDeliveryConfirm,
|
|
|
|
|
+ wrOutApply,
|
|
|
spotPresaleBreachOfContractApply
|
|
spotPresaleBreachOfContractApply
|
|
|
} from '@/services/api/trade'
|
|
} from '@/services/api/trade'
|
|
|
import { formatDate } from "@/filters";
|
|
import { formatDate } from "@/filters";
|
|
@@ -52,14 +53,13 @@ export function useSpotPresaleDeliveryConfirm() {
|
|
|
const { getUserId } = useLoginStore()
|
|
const { getUserId } = useLoginStore()
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- const confirmSubmit = (id: number) => {
|
|
|
|
|
|
|
+ const confirmSubmit = (id: string) => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return spotPresaleDeliveryConfirm({
|
|
return spotPresaleDeliveryConfirm({
|
|
|
data: {
|
|
data: {
|
|
|
UserID: getUserId(),
|
|
UserID: getUserId(),
|
|
|
Remark: '',
|
|
Remark: '',
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
|
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
},
|
|
},
|
|
@@ -80,12 +80,12 @@ export function useSpotPresaleBreachOfContractApply() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId } = useLoginStore()
|
|
const { getUserId } = useLoginStore()
|
|
|
|
|
|
|
|
- const applySubmit = (id: number) => {
|
|
|
|
|
|
|
+ const applySubmit = (id: string) => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return spotPresaleBreachOfContractApply({
|
|
return spotPresaleBreachOfContractApply({
|
|
|
data: {
|
|
data: {
|
|
|
UserID: getUserId(),
|
|
UserID: getUserId(),
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
|
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
},
|
|
},
|
|
@@ -106,18 +106,18 @@ export function useSpotPresalePlayment() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId } = useLoginStore()
|
|
const { getUserId } = useLoginStore()
|
|
|
|
|
|
|
|
- const formData = ref<Partial<Proto.SpotPresalePlaymentReq>>({
|
|
|
|
|
|
|
+ const formData = reactive<Partial<Proto.SpotPresalePlaymentReq>>({
|
|
|
UserID: getUserId(), // 用户ID,必填
|
|
UserID: getUserId(), // 用户ID,必填
|
|
|
ClientType: ClientType.Web, // 终端类型
|
|
ClientType: ClientType.Web, // 终端类型
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- const playmentSubmit = (id: number) => {
|
|
|
|
|
|
|
+ const playmentSubmit = (id: string) => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return spotPresalePlayment({
|
|
return spotPresalePlayment({
|
|
|
data: {
|
|
data: {
|
|
|
...formData,
|
|
...formData,
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
|
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
},
|
|
},
|
|
|
complete: () => {
|
|
complete: () => {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -136,23 +136,22 @@ export function useSpotPresaleTransferListing() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId } = useLoginStore()
|
|
const { getUserId } = useLoginStore()
|
|
|
|
|
|
|
|
- const formData = ref<Partial<Proto.SpotPresaleTransferListingReq>>({
|
|
|
|
|
|
|
+ const formData = reactive<Partial<Proto.SpotPresaleTransferListingReq>>({
|
|
|
UserID: getUserId(), // 用户ID,必填
|
|
UserID: getUserId(), // 用户ID,必填
|
|
|
ClientType: ClientType.Web, // 终端类型
|
|
ClientType: ClientType.Web, // 终端类型
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- const listingSubmit = (id: number) => {
|
|
|
|
|
|
|
+ const listingSubmit = (id: string) => {
|
|
|
/// 转让价格不能为0
|
|
/// 转让价格不能为0
|
|
|
- if (!formData.value.TransferPrice) {
|
|
|
|
|
|
|
+ if (!formData.TransferPrice) {
|
|
|
return Promise.reject('转让价格不能为0')
|
|
return Promise.reject('转让价格不能为0')
|
|
|
}
|
|
}
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
-
|
|
|
|
|
return spotPresaleTransferListing({
|
|
return spotPresaleTransferListing({
|
|
|
data: {
|
|
data: {
|
|
|
...formData,
|
|
...formData,
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
|
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
},
|
|
},
|
|
|
complete: () => {
|
|
complete: () => {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -172,12 +171,12 @@ export function useSpotPresaleTransferCancel() {
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId } = useLoginStore()
|
|
const { getUserId } = useLoginStore()
|
|
|
|
|
|
|
|
- const transferCancelSubmit = (id: number) => {
|
|
|
|
|
|
|
+ const transferCancelSubmit = (id: string) => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return spotPresaleTransferCancel({
|
|
return spotPresaleTransferCancel({
|
|
|
data: {
|
|
data: {
|
|
|
UserID: getUserId(),
|
|
UserID: getUserId(),
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
|
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
},
|
|
},
|
|
@@ -254,4 +253,44 @@ export function useWrListingCancelOrder() {
|
|
|
loading,
|
|
loading,
|
|
|
cancelSubmit
|
|
cancelSubmit
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 仓单明细挂牌请求接口
|
|
|
|
|
+export function useWrOutInApply(holdlb: Model.HoldLBRsp) {
|
|
|
|
|
+ const loading = shallowRef(false)
|
|
|
|
|
+ const { getUserId, getFirstAccountId, getLoginId } = useLoginStore()
|
|
|
|
|
+
|
|
|
|
|
+ const formData = reactive<Partial<Proto.WROutApplyReq>>({
|
|
|
|
|
+ AppointmentRemark: '',
|
|
|
|
|
+ UserID: getUserId(), // 用户ID,必填
|
|
|
|
|
+ AccountID: getFirstAccountId(), // 申请人账户ID
|
|
|
|
|
+ CreatorID: getLoginId(), // 创建人ID
|
|
|
|
|
+ WRStandardID: holdlb.wrstandardid,
|
|
|
|
|
+ WarehouseID: holdlb.warehouseid,
|
|
|
|
|
+ ClientSerialID: Number(v4()), // 客户端流水号
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ const applySubmit = (qty: number) => {
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ return wrOutApply({
|
|
|
|
|
+ data: {
|
|
|
|
|
+ ...formData,
|
|
|
|
|
+ WROutInDetails: [{
|
|
|
|
|
+ LadingBillID: holdlb.ladingbillid,
|
|
|
|
|
+ SubNum: holdlb.subnum,
|
|
|
|
|
+ Qty: qty,
|
|
|
|
|
+ OutQty: qty,
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
|
|
+ complete: () => {
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return {
|
|
|
|
|
+ loading,
|
|
|
|
|
+ formData,
|
|
|
|
|
+ applySubmit
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|