Browse Source

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

li.shaoyi 4 năm trước cách đây
mục cha
commit
7f3ff50aea

+ 38 - 33
src/views/market/spot_trade/spot_trade_order_transaction/components/listing/index.vue

@@ -32,12 +32,12 @@
             <a-col :span="24">
               <a-form-item label="挂牌价格"
                            class="relative"
-                           name="price">
+                           name="FixedPrice">
                 <a-input-number class="dialogInput yellowInput"
                                 style="width: 260px"
                                 :min="0"
                                 :max="99999"
-                                v-model:value="formState.price" />
+                                v-model:value="formState.FixedPrice" />
               </a-form-item>
             </a-col>
           </a-row>
@@ -49,8 +49,8 @@
                 <a-input-number class="dialogInput yellowInput"
                                 style="width: 260px"
                                 :min="0"
-                                :max="99999"
-                                v-model:value="formState.num" />
+                                :max="getListingBuyMaxNum()"
+                                v-model:value="formState.OrderQty" />
                 <span class="input-enumdicname-absolute">{{deliverGoods.enumdicname}}</span>
                 <!-- <div class="labelTip">({{selectedRow.delistminqty}}{{selectedRow.enumdicname}}起)</div> -->
               </a-form-item>
@@ -61,13 +61,13 @@
                    class="mt-20">
               <a-form-item>
                 <a-slider :min="0"
-                          v-model:value="formState.num"
+                          v-model:value="formState.OrderQty"
                           :max="deliverGoods.orderqty"
                           class="formSlider"
                           style="width: 260px" />
                 <div class="unit">
                   <span>0</span>
-                  <span>99999{{deliverGoods.enumdicname}}</span>
+                  <span>{{getListingBuyMaxNum()}}{{deliverGoods.enumdicname}}</span>
                 </div>
               </a-form-item>
             </a-col>
@@ -108,26 +108,27 @@
 </template>
 
 <script lang="ts">
-import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
-import { defineComponent, PropType, ref } from 'vue';
 import Drawer from '@/common/components/drawer/index.vue';
-import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { DelistingType, PriceType } from '@/common/constants/enumCommon';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
-import { _closeModal } from '@/common/setup/modal/modal';
-import { handleForm } from './setup';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { validateAction } from '@/common/setup/form';
-import { FormState } from './interface';
-import { getCanUseMoney } from '@/services/bus/account';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { useListingTradeNumAndPrice } from '@/common/setup/trade';
+import { ListingTradeNumAndPrice } from '@/common/setup/trade/interface';
+import { getCanUseMoney, getSelectedAccountId } from '@/services/bus/account';
+import { geLoginID_number } from '@/services/bus/login';
 import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
-import { OrderReq } from '@/services/socket/order/interface';
 import { Order } from '@/services/socket/order';
-import { DelistingType, PriceType } from '@/common/constants/enumCommon';
-import { geLoginID_number } from '@/services/bus/login';
-import { LongType } from '@/services/socket/login/interface';
-import { v4 as uuidv4 } from 'uuid';
+import { OrderReq } from '@/services/socket/order/interface';
+import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
 import moment from 'moment';
-import Long from 'long';
+import { v4 as uuidv4 } from 'uuid';
+import { defineComponent, PropType, ref } from 'vue';
+import { useBlocksAccount } from '../../spot_trade_order_transaction_swap/components/setup';
+import { FormState } from './interface';
+import { handleForm } from './setup';
+
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_financing_delisting,
     components: { Drawer, PlusOutlined, MinusOutlined },
@@ -142,19 +143,22 @@ export default defineComponent({
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
         // 资金账号
-        const accountList = getAccountTypeList([2]);
         const { rules, formState, formRef } = handleForm();
-        if (accountList.length) {
-            formState.accountid = accountList[0].accountid;
-        }
-        function getSelectedAccount() {
-            return accountList.find((e) => e.accountid === formState.accountid);
-        }
+
         const loading = ref<boolean>(false);
-        function getMoney() {
-            return (formState.price * formState.num).toFixed(2);
-        }
-        // const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.deliverGoods, formState);
+        const { canUseMoney, getSelectedAccount, accountList } = useBlocksAccount(formState);
+
+        // 金额 数量 保证金
+        const param: ListingTradeNumAndPrice<FormState> = {
+            formState,
+            goodscode: props.deliverGoods.goodscode,
+            isFloat: () => {
+                return false;
+            },
+            canUseMoney,
+        };
+        const { getMoney, getListingBuyMaxNum } = useListingTradeNumAndPrice<FormState>(param);
+
         function submit() {
             validateAction<FormState>(formRef, formState).then((res) => {
                 // 挂牌请求 通过挂牌求购进行挂牌
@@ -169,10 +173,10 @@ export default defineComponent({
                     ValidType: 1, // 校验类型 当日有效
                     OperateType: 1, // 操作类型: 申请
                     OrderSrc: 1, // 单据来源: 客户端下单
-                    OrderPrice: res.price, // 委托价格
+                    OrderPrice: res.FixedPrice, // 委托价格
                     OperatorID: Number(geLoginID_number()),
                     // MarketMaxSub: number // 市价允许最大偏差(做市)
-                    OrderQty: res.num, // 委托数量
+                    OrderQty: res.OrderQty, // 委托数量
                     BuyOrSell: 0, // 买卖方向  0 买 1 卖
                     BuildType: 1, // 下单类型  1 建 2 平
                     // CurtQuotePrice: 0, // 保留,计算冻结金额使用
@@ -213,6 +217,7 @@ export default defineComponent({
             getCanUseMoney,
             getSelectedAccount,
             getMoney,
+            getListingBuyMaxNum,
         };
     },
 });

+ 2 - 3
src/views/market/spot_trade/spot_trade_order_transaction/components/listing/interface.ts

@@ -1,6 +1,5 @@
+import { CommomTradeForm } from "@/common/setup/trade/interface";
 
-export interface FormState {
+export interface FormState extends CommomTradeForm {
     accountid: undefined | number,
-    num: number,
-    price: number,
 }

+ 5 - 4
src/views/market/spot_trade/spot_trade_order_transaction/components/listing/setup.ts

@@ -5,16 +5,17 @@ export function handleForm() {
     const formRef = ref();
     const formState: UnwrapRef<FormState> = reactive({
         accountid: undefined,
-        num: 0,
-        price: 0,
+        OrderQty: 0,
+        FixedPrice: 0,
+        PriceMove: 0
     })
     const rules = {
         accountid: [{ required: true, message: '请选择交易账户' }],
-        num: [
+        OrderQty: [
             { required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number' },
             { message: '挂牌数量不能小于0', min: 1, type: 'number' }
         ],
-        price: [
+        FixedPrice: [
             { required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number' },
             { message: '挂牌价格不能小于0', min: 1, type: 'number' }
         ],

+ 2 - 2
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/post_buying/index.vue

@@ -217,7 +217,7 @@ export default defineComponent({
                 if (marginType === 1) {
                     if (getMoney()) {
                         // 履约保证金=挂牌金额*保证金比例
-                        result = ((getMoney() * marginValue) / 100).toFixed(2);
+                        result = (getMoney() * marginValue).toFixed(2);
                     }
                 } else {
                     if (formState.OrderQty) {
@@ -243,7 +243,7 @@ export default defineComponent({
                     // 合约单位
                     const agreeunit = getGoodsAgreeunitByGoodsCode(goodscode);
                     // 最大可挂牌数量=可用/(价格*合约单位*保证金比例
-                    result = money / (((+price * marginValue) / 100) * agreeunit);
+                    result = money / (+price * marginValue * agreeunit);
                 } else {
                     // 最大可挂牌数量=可用/保证金固定值
                     result = money / marginValue;

+ 1 - 1
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/setup.ts

@@ -18,7 +18,7 @@ export const useUserType = () => {
 }
 
 // 交易账号
-export function useBlocksAccount<T extends { accountid: number }>(formState: UnwrapRef<T>) {
+export function useBlocksAccount<T extends { accountid: number | undefined }>(formState: UnwrapRef<T>) {
     // 资金账号
     const accountList = getAccountTypeList([2]);
     if (accountList.length) {

+ 380 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_order_closed/index.vue

@@ -0,0 +1,380 @@
+<template>
+  <!-- 按单平仓-->
+  <Drawer :title="'按单平仓'"
+          :placement="'right'"
+          class="bottom486"
+          :visible="visible"
+          @cancel="cancel">
+    <div class="listed c_c_s_s">
+      <a-form class="inlineForm dialogForm"
+              ref="formRef"
+              :model="formState"
+              :rules="rules">
+        <div class="formBar">
+          <div class="formtop">
+            <div class="firstTitle">
+              <span>合约:{{selectedRow.goodscode}}/{{selectedRow.goodsname}}</span>
+            </div>
+            <div class="secondLine">
+              <div class="left">持仓单号/方向</div>
+              <div class="middle">数量/价格/金额</div>
+              <div class="right">到期日/盈亏</div>
+            </div>
+            <a-checkbox-group class="commonCheckboxGroup"
+                              v-model:value="checked"
+                              @change="checkGroupChange">
+              <div class="lineBar"
+                   v-for="item in tableList"
+                   :key="item.tradeid">
+                <div class="line1">
+                  <div class>
+                    <a-checkbox @change="checkboxChange(item)"
+                                :value="item.tradeid"></a-checkbox>
+                  </div>
+                  <div class="name">{{item.tradeid}}</div>
+                  <div class="date">{{formatTime(item.tradetime, 'd')}}</div>
+                </div>
+                <div class="line2">
+                  <div class="left">{{item.buyorsell === BuyOrSell.buy ? '买入' : '卖出'}}</div>
+                  <div class="middle">
+                    <div>{{item.holderqty}}</div>
+                    <div>{{item.holderprice}}</div>
+                    <div>{{item.holderamount}}</div>
+                  </div>
+                  <div class="right red">+100</div>
+                </div>
+              </div>
+            </a-checkbox-group>
+          </div>
+        </div>
+        <div class="fixedBtns">
+          <a-row :gutter="24">
+            <a-col :span="24"
+                   class="mt12">
+              <a-form-item label="估算价"
+                           name="price"
+                           class="inputIconBox mb10 not-copy">
+                <a-input-number class="commonInput not-copy"
+                                v-model:value="formState.price"
+                                style="width: 200px"
+                                :min="0" />
+                <MinusOutlined @click="decreasePrice" />
+                <PlusOutlined @click="increasePirce" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="估算金额"
+                           class="mb10 not-copy ">
+                <span class="white">50400.20</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-form-item class="btnCenter mt10">
+            <a-button class="listedBtn"
+                      :loading="loading"
+                      :disabled="loading"
+                      @click="submit">提交</a-button>
+            <a-button class="ml10 cancelBtn"
+                      @click="cancel">取消</a-button>
+          </a-form-item>
+        </div>
+      </a-form>
+    </div>
+  </Drawer>
+</template>
+
+<script lang="ts">
+import Drawer from '@/common/components/drawer/index.vue';
+import UploadImg from '@/common/components/uploadImg/index.vue';
+import { BuyOrSell } from '@/common/constants/enumCommon';
+import { ModalEnum } from '@/common/constants/modalNameEnum';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { validateAction } from '@/common/setup/form';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { queryTableList } from '@/common/setup/table';
+import { getUserId } from '@/services/bus/account';
+import { geLoginID_number } from '@/services/bus/login';
+import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
+import { queryTradeHolderDetail } from '@/services/go/order';
+import { QueryTradeHolderDetailReq } from '@/services/go/order/interface';
+import { tradeHoldTransferApply } from '@/services/proto/warehousetrade';
+import { TradeHoldTransferApplyReq } from '@/services/proto/warehousetrade/interface';
+import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
+import { message } from 'ant-design-vue';
+import Long from 'long';
+import { defineComponent, PropType } from 'vue';
+import { BargainList, FormState } from './interface';
+import { handleForm, useCheckd, usePrice } from './setup';
+import { formatTime } from '@/common/methods';
+
+export default defineComponent({
+    name: ModalEnum.commodity_contract_summary_settlement,
+    components: { Drawer, UploadImg, PlusOutlined, MinusOutlined },
+    emits: ['cancel', 'update'],
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryTradePositionRsp>,
+            default: {},
+        },
+        buyOrSell: {
+            type: Number as PropType<BuyOrSell>,
+            default: BuyOrSell.buy,
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const { rules, formState, formRef } = handleForm();
+        // 选中逻辑
+        const { checked, selected, checkGroupChange, checkboxChange } = useCheckd();
+
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<BargainList>();
+        const param: QueryTradeHolderDetailReq = {
+            buyorsell: props.selectedRow.buyorsell,
+            userid: getUserId(),
+            goodsid: props.selectedRow.goodsid,
+        };
+        queryTable(queryTradeHolderDetail, param).then((res) => {
+            tableList.value = res.map((e, i) => {
+                if (i) {
+                    return { ...e, checked: false };
+                } else {
+                    // 默认勾选第一个
+                    checked.value = e.tradeid;
+                    const result = { ...e, checked: true };
+                    selected.value = result;
+                    return result;
+                }
+            });
+        });
+
+        const toFixed0 = (value: number) => +value.toFixed(0);
+
+        function submit() {
+            if (!selected.value) {
+                message.warn('请选择持仓');
+                return;
+            }
+            validateAction<FormState>(formRef, formState).then((res) => {
+                const param: TradeHoldTransferApplyReq = {
+                    TradeID: Long.fromString(selected.value!.tradeid),
+                    BuyorSell: selected.value!.buyorsell,
+                    TransferPrice: res.price,
+                    ApplySrc: 2,
+                    ApplicantID: geLoginID_number()!,
+                    Remark: '',
+                };
+                requestResultLoadingAndInfo(tradeHoldTransferApply, param, loading, ['协议平仓成功', '协议平仓失败:']).then(() => {
+                    cancel(true);
+                });
+            });
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            tableList,
+            loading,
+            toFixed0,
+            rules,
+            formState,
+            formRef,
+            ...usePrice(formState),
+            checked,
+            checkGroupChange,
+            checkboxChange,
+            BuyOrSell,
+            formatTime,
+        };
+    },
+});
+</script>
+
+<style lang="less" scoped>
+.c_c_s_s {
+    background: @m-black40;
+    width: 100%;
+    height: 100%;
+    position: relative;
+    .formBar {
+        padding: 0;
+        height: calc(100% - 170px);
+        background: @m-black41;
+        .formtop {
+            width: 100%;
+            padding: 0 20px;
+            .flex;
+            flex-direction: column;
+            .firstTitle {
+                width: calc(100% + 40px);
+                height: 40px;
+                line-height: 40px;
+                margin-left: -20px;
+                padding: 0 20px;
+                font-size: 14px;
+                color: @m-white6;
+                border-bottom: 1px solid @m-black42;
+            }
+            .secondLine {
+                width: 100%;
+                height: 40px;
+                line-height: 40px;
+                display: inline-flex;
+                > div {
+                    flex: 1;
+                    font-size: 14px;
+                    color: @m-grey1;
+                }
+                .left {
+                    text-align: left;
+                }
+                .middle {
+                    text-align: center;
+                }
+                .right {
+                    text-align: right;
+                }
+            }
+            .lineBar {
+                width: 100%;
+                min-height: 100px;
+                padding-left: 15px;
+                padding-right: 10px;
+                background: @m-blue19;
+                margin-bottom: 10px;
+                .rounded-corners(5px);
+                .line1 {
+                    display: inline-flex;
+                    user-select: none;
+                    width: 100%;
+                    height: 40px;
+                    line-height: 40px;
+                    font-size: 16px;
+                    color: @m-white6;
+                    white-space: nowrap;
+                    text-overflow: ellipsis;
+                    overflow: hidden;
+                    border-bottom: 1px solid @m-blue20;
+                    > div {
+                        align-self: center;
+                        align-items: center;
+                    }
+                    .name {
+                        margin-left: 10px;
+                    }
+                    .date {
+                        flex: 1;
+                        text-align: right;
+                        font-size: 14px;
+                        color: @m-grey1;
+                    }
+                }
+                .line2 {
+                    width: 100%;
+                    user-select: none;
+                    padding: 12px 0 14px 0;
+                    display: inline-flex;
+                    .left {
+                        width: 25%;
+                        color: @m-white6;
+                        font-size: 14px;
+                        white-space: nowrap;
+                        text-overflow: ellipsis;
+                        overflow: hidden;
+                        line-height: 34px;
+                        // }
+                    }
+                    .middle {
+                        width: 50%;
+                        display: inline-flex;
+                        justify-content: space-between;
+                        padding: 0 10px;
+                        font-size: 16px;
+                        color: @m-white6;
+                        line-height: 34px;
+                        > div {
+                            white-space: nowrap;
+                        }
+                    }
+                    .right {
+                        width: 25%;
+                        font-size: 16px;
+                        text-align: right;
+                        line-height: 34px;
+                        white-space: nowrap;
+                    }
+                }
+            }
+        }
+    }
+    .fixedBtns {
+        padding-top: 0;
+        left: 0;
+        right: 0;
+        padding-left: 20px;
+        padding-right: 20px;
+    }
+    .formbottom {
+        width: 100%;
+        .flex;
+        flex-direction: column;
+        background: @m-black40;
+        padding: 0 18px 0 20px;
+        .line1 {
+            width: 100%;
+            padding: 0 12px 0 16px;
+            height: 36px;
+            line-height: 36px;
+            display: inline-flex;
+            justify-content: space-between;
+            color: @m-grey1;
+            font-size: 14px;
+        }
+        .line2 {
+            width: 100%;
+            height: 35px;
+            line-height: 34px;
+            padding-left: 15px;
+            padding-right: 10px;
+            background: @m-black43;
+            .rounded-corners(5px);
+            font-size: 14px;
+            color: @m-grey1;
+            display: inline-flex;
+            justify-content: space-between;
+            > div {
+                align-self: baseline;
+                align-items: baseline;
+            }
+            .right {
+                display: inline-flex;
+                color: @m-yellow6;
+                div:last-child {
+                    font-size: 16px;
+                    margin-left: 2px;
+                }
+            }
+        }
+        .line3 {
+            margin-top: 16px;
+            width: 100%;
+            height: 15px;
+            line-height: 15px;
+            font-size: 14px;
+            text-align: right;
+            color: @m-white6;
+        }
+    }
+    .inputIconBox {
+        .ant-form-item-children {
+            .anticon-plus {
+                right: 156px;
+            }
+        }
+    }
+}
+</style>;
+
+function queryTradeHolderDetail(queryTradeHolderDetail: any, param: { applytype: number; }) {
+  throw new Error('Function not implemented.');
+}

+ 10 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_order_closed/interface.ts

@@ -0,0 +1,10 @@
+import { QueryTradeHolderDetailRsp } from "@/services/go/order/interface";
+
+export interface FormState {
+    price: number,
+}
+
+
+export interface BargainList extends QueryTradeHolderDetailRsp {
+    checked: boolean
+}

+ 55 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_order_closed/setup.ts

@@ -0,0 +1,55 @@
+import { validateCommon } from "@/common/setup/validate";
+import { RuleObject } from "ant-design-vue/lib/form/interface";
+import { reactive, ref, UnwrapRef } from "vue";
+import { BargainList, FormState } from "./interface";
+
+export function handleForm() {
+    const formRef = ref();
+    const v_num = async (rule: RuleObject, value: number) => {
+        return validateCommon(value, '请输入协议价');
+    };
+    const formState: UnwrapRef<FormState> = reactive({
+        price: 0,
+    })
+    const rules = {
+        price: [
+            { require, message: '请输入协议价', trigger: 'blur', type: 'number', validator: v_num },
+        ],
+    }
+    return { rules, formState, formRef }
+}
+
+export function usePrice(formState: UnwrapRef<FormState>) {
+    function increasePirce() {
+        formState.price++
+    }
+    function decreasePrice() {
+        if (formState.price) {
+            formState.price--
+        }
+    }
+    return { increasePirce, decreasePrice }
+}
+
+export function useCheckd() {
+    const checked = ref<string>();
+    const selected = ref<BargainList>()
+    function checkGroupChange(checkedValue: string[]) {
+        checked.value = checkedValue[checkedValue.length - 1];
+    }
+    function checkboxChange(item: BargainList) {
+        selected.value = item;
+    }
+    return { checked, selected, checkGroupChange, checkboxChange }
+}
+
+// 计算盈亏
+export function useProfit(item: BargainList) {
+    const { buyorsell, holderprice, agreeunit, holderqty } = item
+    // let result = '--'
+    // if(buyorsell === BuyOrSell.buy) {
+
+    // } else {
+
+    // }
+}

+ 7 - 5
src/views/order/commodity_contract/components/commodity_contract_summary/index.vue

@@ -72,6 +72,7 @@ export default defineComponent({
         [ModalEnum.commodity_contract_summary_settlement]: defineAsyncComponent(() => import('./components/commodity_contract_summary_settlement/index.vue')),
         [ModalEnum.commodity_contract_summary_transfer]: defineAsyncComponent(() => import('./components/commodity_contract_summary_transfer/index.vue')),
         commodity_contract_summary_deal_closed: defineAsyncComponent(() => import('./components/commodity_contract_summary_deal_closed/index.vue')),
+        commodity_contract_summary_order_closed: defineAsyncComponent(() => import('./components/commodity_contract_summary_order_closed/index.vue')),
     },
     setup() {
         // 表格列表数据
@@ -102,11 +103,12 @@ export default defineComponent({
         }
 
         function handleBtnList(record: QueryTradePositionRsp, btnList: BtnListType[]) {
-            if (findGoodsTradeModeById(record.goodsid) === TradeMode.DiaoQi) {
-                return btnList.filter((e) => e.code === 'commodity_contract_summary_deal_closed');
-            } else {
-                return btnList.filter((e) => e.code !== 'commodity_contract_summary_deal_closed');
-            }
+            // 挂牌点选
+            const listing = ['commodity_contract_summary_transfer', 'commodity_contract_summary_settlement'];
+            // 贸易圈
+            const diaoqi = ['commodity_contract_summary_deal_closed', 'commodity_contract_summary_order_closed'];
+            const arr = findGoodsTradeModeById(record.goodsid) === TradeMode.DiaoQi ? diaoqi : listing;
+            return btnList.filter((e) => arr.includes(e.code));
         }
         return {
             ...handleComposeOrderTable<QueryTradePositionRsp>(param),

+ 5 - 3
src/views/order/financing_manager/components/financing_manager_contract/components/buyback/index.vue

@@ -64,8 +64,10 @@
             <a-col :span="12">
               <!--(回购数量/合同剩余数量) * 合同剩余金额 -->
               <a-form-item label="本次回购金额">
-                <span
+                <span v-if="selectedRow.remainwrpositionqty"
                       class="white ml10">{{ (((formState.num === 0 ? 1 : formState.num) * selectedRow.remainamount) / selectedRow.remainwrpositionqty).toFixed(2) + " 元" }}</span>
+                <span v-else
+                      class="white ml10">--</span>
               </a-form-item>
             </a-col>
             <a-col :span="12">
@@ -80,13 +82,13 @@
                  class="fixedBtns">
             <a-form-item class="btnCenter">
               <a-button class="listedBtn"
-                        v-if="selectedRow.buybackwrpositionqty !== selectedRow.remainwrpositionqty"
+                        v-if="selectedRow.remainwrpositionqty"
                         :loading="loading"
                         :disabled="loading"
                         @click="submit">提交</a-button>
               <a-button class="listedBtn"
                         v-else
-                        @click="cancel">提交</a-button>
+                        @click="cancel">取消</a-button>
             </a-form-item>
           </a-col>
         </a-row>