|
@@ -211,10 +211,16 @@ export default defineComponent({
|
|
|
function getSelectedAccount() {
|
|
function getSelectedAccount() {
|
|
|
return accountList.find((e) => e.accountid === formState.accountid)!;
|
|
return accountList.find((e) => e.accountid === formState.accountid)!;
|
|
|
}
|
|
}
|
|
|
|
|
+ function getPrice() {
|
|
|
|
|
+ return isBargin() ? formState.price : props.selectedRow.fixedprice;
|
|
|
|
|
+ }
|
|
|
|
|
+ function getNum() {
|
|
|
|
|
+ return isCanpart() ? formState.num : props.selectedRow.orderqty;
|
|
|
|
|
+ }
|
|
|
// 摘牌金额
|
|
// 摘牌金额
|
|
|
function getMoney() {
|
|
function getMoney() {
|
|
|
- const price = isBargin() ? formState.price : props.selectedRow.fixedprice;
|
|
|
|
|
- const num = isCanpart() ? formState.num : props.selectedRow.orderqty;
|
|
|
|
|
|
|
+ const price = getPrice();
|
|
|
|
|
+ const num = getNum();
|
|
|
if (price) {
|
|
if (price) {
|
|
|
return (price * num).toFixed(2);
|
|
return (price * num).toFixed(2);
|
|
|
} else {
|
|
} else {
|
|
@@ -223,8 +229,8 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
// 履约保证金
|
|
// 履约保证金
|
|
|
function getMargin() {
|
|
function getMargin() {
|
|
|
- const price = isBargin() ? formState.price : props.selectedRow.fixedprice;
|
|
|
|
|
- const num = isCanpart() ? formState.num : props.selectedRow.orderqty;
|
|
|
|
|
|
|
+ const price = getPrice();
|
|
|
|
|
+ const num = getNum();
|
|
|
let result = 0;
|
|
let result = 0;
|
|
|
const { marginvalue } = props.selectedRow;
|
|
const { marginvalue } = props.selectedRow;
|
|
|
if (price && num && marginvalue) {
|
|
if (price && num && marginvalue) {
|
|
@@ -272,16 +278,24 @@ export default defineComponent({
|
|
|
|
|
|
|
|
function submit() {
|
|
function submit() {
|
|
|
validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ const price = getPrice();
|
|
|
|
|
+ const num = getNum();
|
|
|
if (isBargin()) {
|
|
if (isBargin()) {
|
|
|
// 议价摘牌
|
|
// 议价摘牌
|
|
|
- const param: WrBargainApplyReq = {
|
|
|
|
|
- WRTradeOrderID: Long.fromString(props.selectedRow.wrtradeorderid),
|
|
|
|
|
- ApplyQty: 10,
|
|
|
|
|
- UserID: String(getUserId()),
|
|
|
|
|
|
|
+ const param = {
|
|
|
|
|
+ RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid,
|
|
|
|
|
+ ApplyQty: num,
|
|
|
|
|
+ UserID: getUserId(),
|
|
|
AccountID: getSelectedAccountId().toString(),
|
|
AccountID: getSelectedAccountId().toString(),
|
|
|
- BuyOrSell: props.buyOrSell.toString(),
|
|
|
|
|
- ApplyPrice: formState.price.toString(),
|
|
|
|
|
|
|
+ BuyOrSell: isBuy() ? BuyOrSell.sell : BuyOrSell.buy,
|
|
|
|
|
+ ApplyPrice: price.toString(),
|
|
|
ApplyRemark: '',
|
|
ApplyRemark: '',
|
|
|
|
|
+ OrderSrc: 0, // uint32 委托来源
|
|
|
|
|
+ ClientSerialNo: uuidv4(), // string 客户端流水号
|
|
|
|
|
+ ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
|
|
|
|
|
+ ClientType: 4, // uint32 终端类型
|
|
|
|
|
+ OperatorID: getUserId(), // uint64 操作员账号ID
|
|
|
};
|
|
};
|
|
|
requestResultLoadingAndInfo(wrBargainApply, param, loading, ['议价摘牌成功', '议价摘牌失败:']).then(() => {
|
|
requestResultLoadingAndInfo(wrBargainApply, param, loading, ['议价摘牌成功', '议价摘牌失败:']).then(() => {
|
|
|
cancel(true);
|
|
cancel(true);
|
|
@@ -294,13 +308,13 @@ export default defineComponent({
|
|
|
AccountID: getSelectedAccountId(), // uint64 资金账号
|
|
AccountID: getSelectedAccountId(), // uint64 资金账号
|
|
|
RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
|
|
RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
|
|
|
WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
|
|
WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
|
|
|
- OrderQty: res.num as number, // uint64 委托数量
|
|
|
|
|
|
|
+ OrderQty: num, // uint64 委托数量
|
|
|
OrderSrc: 0, // uint32 委托来源
|
|
OrderSrc: 0, // uint32 委托来源
|
|
|
ClientSerialNo: uuidv4(), // string 客户端流水号
|
|
ClientSerialNo: uuidv4(), // string 客户端流水号
|
|
|
ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
|
|
ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
|
|
|
ClientType: 4, // uint32 终端类型
|
|
ClientType: 4, // uint32 终端类型
|
|
|
OperatorID: getUserId(), // uint64 操作员账号ID
|
|
OperatorID: getUserId(), // uint64 操作员账号ID
|
|
|
- BuyOrSell: 0, // uint32 买卖方向
|
|
|
|
|
|
|
+ BuyOrSell: isBuy() ? BuyOrSell.sell : BuyOrSell.buy, // uint32 买卖方向
|
|
|
ApplyID: 0, // uint64 申请ID
|
|
ApplyID: 0, // uint64 申请ID
|
|
|
LadingBillId: 0, // uint64 提单id(wrholdlb的LadingBillId字段),卖的时候填写
|
|
LadingBillId: 0, // uint64 提单id(wrholdlb的LadingBillId字段),卖的时候填写
|
|
|
SubNum: 0, // uint64 提单子单号(wrholdlb的SubNum字段),卖的时候填写
|
|
SubNum: 0, // uint64 提单子单号(wrholdlb的SubNum字段),卖的时候填写
|