|
|
@@ -1,4 +1,4 @@
|
|
|
-import { ref, shallowRef } from 'vue'
|
|
|
+import { reactive, ref, shallowRef } from 'vue'
|
|
|
import { v4 } from 'uuid'
|
|
|
import { ClientType, OrderSrc } from '@/constants/client'
|
|
|
import { useLoginStore } from '@/stores'
|
|
|
@@ -9,6 +9,7 @@ import { spotPresaleDestingOrder,
|
|
|
spotPresalePlayment,
|
|
|
wrListingCancelOrder,
|
|
|
spotPresaleDeliveryConfirm,
|
|
|
+ wrOutApply,
|
|
|
spotPresaleBreachOfContractApply } from '@/services/api/trade'
|
|
|
import { formatDate } from "@/filters";
|
|
|
import Long from 'long'
|
|
|
@@ -50,14 +51,13 @@ export function useSpotPresaleDeliveryConfirm() {
|
|
|
const { getUserId } = useLoginStore()
|
|
|
const loading = shallowRef(false)
|
|
|
|
|
|
-
|
|
|
- const confirmSubmit = (id: number) => {
|
|
|
+ const confirmSubmit = (id: string) => {
|
|
|
loading.value = true
|
|
|
return spotPresaleDeliveryConfirm({
|
|
|
data: {
|
|
|
UserID: getUserId(),
|
|
|
Remark: '',
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
},
|
|
|
@@ -78,12 +78,12 @@ export function useSpotPresaleBreachOfContractApply() {
|
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId } = useLoginStore()
|
|
|
|
|
|
- const applySubmit = (id: number) => {
|
|
|
+ const applySubmit = (id: string) => {
|
|
|
loading.value = true
|
|
|
return spotPresaleBreachOfContractApply({
|
|
|
data: {
|
|
|
UserID: getUserId(),
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
},
|
|
|
@@ -104,18 +104,18 @@ export function useSpotPresalePlayment() {
|
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId } = useLoginStore()
|
|
|
|
|
|
- const formData = ref<Partial<Proto.SpotPresalePlaymentReq>>({
|
|
|
+ const formData = reactive<Partial<Proto.SpotPresalePlaymentReq>>({
|
|
|
UserID: getUserId(), // 用户ID,必填
|
|
|
ClientType: ClientType.Web, // 终端类型
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
})
|
|
|
|
|
|
- const playmentSubmit = (id: number) => {
|
|
|
+ const playmentSubmit = (id: string) => {
|
|
|
loading.value = true
|
|
|
return spotPresalePlayment({
|
|
|
data: {
|
|
|
...formData,
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
},
|
|
|
complete: () => {
|
|
|
loading.value = false
|
|
|
@@ -134,23 +134,22 @@ export function useSpotPresaleTransferListing() {
|
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId } = useLoginStore()
|
|
|
|
|
|
- const formData = ref<Partial<Proto.SpotPresaleTransferListingReq>>({
|
|
|
+ const formData = reactive<Partial<Proto.SpotPresaleTransferListingReq>>({
|
|
|
UserID: getUserId(), // 用户ID,必填
|
|
|
ClientType: ClientType.Web, // 终端类型
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
})
|
|
|
|
|
|
- const listingSubmit = (id: number) => {
|
|
|
+ const listingSubmit = (id: string) => {
|
|
|
/// 转让价格不能为0
|
|
|
- if (!formData.value.TransferPrice) {
|
|
|
+ if (!formData.TransferPrice) {
|
|
|
return Promise.reject('转让价格不能为0')
|
|
|
}
|
|
|
loading.value = true
|
|
|
-
|
|
|
return spotPresaleTransferListing({
|
|
|
data: {
|
|
|
...formData,
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
},
|
|
|
complete: () => {
|
|
|
loading.value = false
|
|
|
@@ -170,12 +169,12 @@ export function useSpotPresaleTransferCancel() {
|
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId } = useLoginStore()
|
|
|
|
|
|
- const transferCancelSubmit = (id: number) => {
|
|
|
+ const transferCancelSubmit = (id: string) => {
|
|
|
loading.value = true
|
|
|
return spotPresaleTransferCancel({
|
|
|
data: {
|
|
|
UserID: getUserId(),
|
|
|
- WRTradeDetailID: Long.fromNumber(id),
|
|
|
+ WRTradeDetailID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
},
|
|
|
@@ -196,13 +195,13 @@ export function useSpotPresaleTransferDesting() {
|
|
|
const loading = shallowRef(false)
|
|
|
const { getUserId , getFirstAccountId} = useLoginStore()
|
|
|
|
|
|
- const destingSubmit = (id: number) => {
|
|
|
+ const destingSubmit = (id: string) => {
|
|
|
loading.value = true
|
|
|
return spotPresaleTransferDesting({
|
|
|
data: {
|
|
|
UserID: getUserId(),
|
|
|
AccountID: getFirstAccountId(),
|
|
|
- TransferID: Long.fromNumber(id),
|
|
|
+ TransferID: Long.fromString(id),
|
|
|
ClientSerialNo: v4(), // 客户端流水号
|
|
|
ClientType: ClientType.Web // 终端类型
|
|
|
},
|
|
|
@@ -247,4 +246,44 @@ export function useWrListingCancelOrder() {
|
|
|
loading,
|
|
|
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
|
|
|
+ }
|
|
|
}
|