|
|
@@ -1,118 +1,123 @@
|
|
|
<template>
|
|
|
- <!-- 仓单贸易 一口价 摘牌 -->
|
|
|
- <Drawer
|
|
|
- :title="'摘牌'"
|
|
|
- :placement="'top'"
|
|
|
- :visible="visible"
|
|
|
- width="486px"
|
|
|
- height="479px"
|
|
|
- class="top"
|
|
|
- >
|
|
|
- <div class="delisting">
|
|
|
- <div class="formBar">
|
|
|
- <a-form class="inlineForm dialogForm" ref="formRef">
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-item label="交易账户">
|
|
|
- <a-select
|
|
|
- class="inlineFormSelect"
|
|
|
- style="width: 260px"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
- <!-- <a-select-option value="1">一口价</a-select-option>
|
|
|
- <a-select-option value="2">一口价2</a-select-option>-->
|
|
|
- </a-select>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-item label="挂牌方">
|
|
|
- <span class="white">南方铜业</span>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-item label="挂牌价格">
|
|
|
- <span class="yellow">1680.00</span>
|
|
|
- </a-form-item>
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="24"></a-col>
|
|
|
- </a-row>
|
|
|
- <a-form-item label="挂牌数量">
|
|
|
- <span class="white">100吨</span>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-item label="摘牌数量">
|
|
|
- <a-input
|
|
|
- class="commonInput stepper"
|
|
|
- suffix="吨"
|
|
|
- style="width: 260px"
|
|
|
- />
|
|
|
- <div class="labelTip">(10吨起)</div>
|
|
|
- <div class="minusBtn">
|
|
|
- <MinusOutlined />
|
|
|
- </div>
|
|
|
- <div class="plusBtn">
|
|
|
- <PlusOutlined />
|
|
|
- </div>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-item>
|
|
|
- <a-progress class="formProgress" :percent="30" />
|
|
|
- <div class="unit">
|
|
|
- <span>0</span>
|
|
|
- <span>300吨</span>
|
|
|
- </div>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="12"> </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="24" class="mt-20">
|
|
|
- <a-form-item label="挂牌金额">
|
|
|
- <span class="white">50400.00</span>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-item class="tc">
|
|
|
- <a-button class="listedBtn" @click="submit">卖出</a-button>
|
|
|
- <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </Drawer>
|
|
|
+ <!-- 仓单贸易 一口价 摘牌 -->
|
|
|
+ <Drawer :title="'摘牌'"
|
|
|
+ :placement="'top'"
|
|
|
+ :visible="visible"
|
|
|
+ width="486px"
|
|
|
+ height="479px"
|
|
|
+ @cancel="cancel"
|
|
|
+ class="top">
|
|
|
+ <div class="delisting">
|
|
|
+ <div class="formBar">
|
|
|
+ <a-form class="inlineForm dialogForm"
|
|
|
+ ref="formRef"
|
|
|
+ :model="formState"
|
|
|
+ :rules="rules">
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-item label="交易账户"
|
|
|
+ name="accountid">
|
|
|
+ <a-select class="inlineFormSelect"
|
|
|
+ style="width: 260px"
|
|
|
+ v-model:value="formState.accountid"
|
|
|
+ placeholder="请选择">
|
|
|
+ <a-select-option v-for="item in accountList"
|
|
|
+ :value="item.accountid"
|
|
|
+ :key="item.accountid">
|
|
|
+ {{item.accountid}}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-item label="挂牌方">
|
|
|
+ <span class="white">{{selectedRow.username}}</span>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-item label="挂牌价格">
|
|
|
+ <span class="yellow">{{selectedRow.fixedprice}}</span>
|
|
|
+ </a-form-item>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="24"></a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-form-item label="挂牌数量">
|
|
|
+ <span class="white">{{selectedRow.orderqty}}吨</span>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-item label="摘牌数量"
|
|
|
+ name="num">
|
|
|
+ <a-input-number class="dialogInput"
|
|
|
+ style="width: 260px"
|
|
|
+ v-model:value="formState.num"
|
|
|
+ suffix="吨" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="12"
|
|
|
+ class="mt-20">
|
|
|
+ <a-form-item>
|
|
|
+ <a-slider :min="0"
|
|
|
+ v-model:value="formState.num"
|
|
|
+ :max="selectedRow.orderqty"
|
|
|
+ class="formSlider" />
|
|
|
+ <div class="unit">
|
|
|
+ <span>1</span>
|
|
|
+ <span>{{selectedRow.orderqty}}</span>
|
|
|
+ </div>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12"> </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="24"
|
|
|
+ class="mt-20">
|
|
|
+ <a-form-item label="挂牌金额">
|
|
|
+ <span class="white">50400.00</span>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="24">
|
|
|
+ <a-form-item class="tc">
|
|
|
+ <a-button class="listedBtn"
|
|
|
+ @click="submit">卖出</a-button>
|
|
|
+ <a-button class="ml10 cancelBtn"
|
|
|
+ @click="cancel">取消</a-button>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Drawer>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
|
|
|
import { defineComponent, PropType, ref } from 'vue';
|
|
|
-import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
|
|
|
import Drawer from '@/common/components/drawer/index.vue';
|
|
|
-import { QueryWrPositionReq, WrOrderQuote, WrOrderQuoteDetail, WrPosition } from '@/services/go/wrtrade/interface';
|
|
|
-import { getSelectedAccountId, getUserId } from '@/services/bus/account';
|
|
|
+import { WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
|
|
|
+import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
|
|
|
import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
-import { HdWRDealOrder, hdWROrder } from '@/services/proto/warehousetrade';
|
|
|
+import { HdWRDealOrder } from '@/services/proto/warehousetrade';
|
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
|
import moment from 'moment';
|
|
|
import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
|
import { HdWRDealOrderReq } from '@/services/proto/warehousetrade/interface';
|
|
|
-import { Long } from '@/services/socket/login/interface/long';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
import { message } from 'ant-design-vue';
|
|
|
-
|
|
|
+import { handleForm } from './setup';
|
|
|
+import { validateAction } from '@/common/setup/form';
|
|
|
+import { ListingForm } from './interface';
|
|
|
export default defineComponent({
|
|
|
name: ModalEnum.spot_trade_warehouse_delisting,
|
|
|
components: { Drawer, PlusOutlined, MinusOutlined },
|
|
|
@@ -130,47 +135,49 @@ export default defineComponent({
|
|
|
|
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
+ const accountList = getAccountTypeList([2]);
|
|
|
const data = props.selectedRow;
|
|
|
+ const { rules, formState, formRef } = handleForm(props.selectedRow);
|
|
|
console.log('data', data);
|
|
|
- const num = ref<number>(0);
|
|
|
const loading = ref<boolean>(false);
|
|
|
function submit() {
|
|
|
- if (!num.value) {
|
|
|
- message.error('请输入数量!');
|
|
|
- return;
|
|
|
- }
|
|
|
- // 摘卖方向
|
|
|
- const param: HdWRDealOrderReq = {
|
|
|
- UserID: getUserId(), // uint32 用户ID
|
|
|
- AccountID: getSelectedAccountId(), // uint64 资金账号
|
|
|
- RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
|
|
|
- WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
|
|
|
- OrderQty: num.value, // uint64 委托数量
|
|
|
- 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
|
|
|
- BuyOrSell: 0, // uint32 买卖方向
|
|
|
- ApplyID: 0, // uint64 申请ID
|
|
|
- LadingBillId: 0, // uint64 提单id(wrholdlb的LadingBillId字段),卖的时候填写
|
|
|
- SubNum: 0, // uint64 提单子单号(wrholdlb的SubNum字段),卖的时候填写
|
|
|
- WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
|
|
|
- TradeDate: moment().format('YYYYMMDD'), // string 交易日
|
|
|
- DeliveryMonth: '', // string 交收月
|
|
|
- HasWr: 1, // uint32 是否有仓单-0:没有仓单 1:有仓单
|
|
|
- };
|
|
|
- // console.log(param);
|
|
|
- requestResultLoadingAndInfo(HdWRDealOrder, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {
|
|
|
- cancel(true);
|
|
|
+ validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
|
+ // 摘卖方向
|
|
|
+ const param: HdWRDealOrderReq = {
|
|
|
+ UserID: getUserId(), // uint32 用户ID
|
|
|
+ AccountID: getSelectedAccountId(), // uint64 资金账号
|
|
|
+ RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
|
|
|
+ WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
|
|
|
+ OrderQty: res.num as number, // uint64 委托数量
|
|
|
+ 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
|
|
|
+ BuyOrSell: 0, // uint32 买卖方向
|
|
|
+ ApplyID: 0, // uint64 申请ID
|
|
|
+ LadingBillId: 0, // uint64 提单id(wrholdlb的LadingBillId字段),卖的时候填写
|
|
|
+ SubNum: 0, // uint64 提单子单号(wrholdlb的SubNum字段),卖的时候填写
|
|
|
+ WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
|
|
|
+ TradeDate: moment().format('YYYYMMDD'), // string 交易日
|
|
|
+ DeliveryMonth: '', // string 交收月
|
|
|
+ HasWr: 1, // uint32 是否有仓单-0:没有仓单 1:有仓单
|
|
|
+ };
|
|
|
+ // console.log(param);
|
|
|
+ requestResultLoadingAndInfo(HdWRDealOrder, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {
|
|
|
+ cancel(true);
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
visible,
|
|
|
cancel,
|
|
|
+ accountList,
|
|
|
submit,
|
|
|
- num,
|
|
|
+ rules,
|
|
|
+ formState,
|
|
|
+ formRef,
|
|
|
};
|
|
|
},
|
|
|
});
|