|
|
@@ -29,10 +29,15 @@
|
|
|
<div class="line1">
|
|
|
<div class>
|
|
|
<a-checkbox @change="checkboxChange(item)"
|
|
|
+ :disabled="item.holderdays"
|
|
|
:value="item.tradeid"></a-checkbox>
|
|
|
</div>
|
|
|
- <div class="name">{{ item.tradeid }}</div>
|
|
|
- <div class="date">{{ formatTime(item.tradetime, 'd') }}</div>
|
|
|
+ <div class="name">{{ item.tradeid }}
|
|
|
+ <template v-if="item.holderdays">
|
|
|
+ <span class="red">{{item.holderdays}}</span>天后可平
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div class="date">{{ formatTime(item.expiredate, 'd') }}</div>
|
|
|
</div>
|
|
|
<div class="line2">
|
|
|
<div class="left">{{ item.buyorsell === BuyOrSell.buy ? '买入' : '卖出' }}</div>
|
|
|
@@ -41,32 +46,28 @@
|
|
|
<div>{{ item.holderprice }}</div>
|
|
|
<div>{{ item.holderamount }}</div>
|
|
|
</div>
|
|
|
- <div class="right red">+100</div>
|
|
|
+ <div class="right red">
|
|
|
+ {{useProfit(item, goodscode)}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-checkbox-group>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="fixedBtns">
|
|
|
- <a-row :gutter="24"
|
|
|
- v-if="false">
|
|
|
+ <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" />
|
|
|
+ <!-- 估算价取标的商品行情的最新价 -->
|
|
|
+ <span class="white">{{getQuoteDayInfoByCodeFindPrice(goodscode)}}</span>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-item label="估算金额"
|
|
|
class="mb10 not-copy">
|
|
|
- <span class="white">50400.20</span>
|
|
|
+ <span class="white">{{getMoney()}}</span>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
@@ -105,8 +106,12 @@ 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 { handleForm, usePrice } from './setup';
|
|
|
import { formatTime } from '@/common/methods';
|
|
|
+import { useProfit, useCheckd } from '../setup';
|
|
|
+import { QueryQuoteGoodsListRsp } from '@/services/go/Tjmd/interface';
|
|
|
+import { findGoodsCode } from '../../setup';
|
|
|
+import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: ModalEnum.commodity_contract_summary_settlement,
|
|
|
@@ -121,8 +126,14 @@ export default defineComponent({
|
|
|
type: Number as PropType<BuyOrSell>,
|
|
|
default: BuyOrSell.buy,
|
|
|
},
|
|
|
+ swapList: {
|
|
|
+ type: Array as PropType<QueryQuoteGoodsListRsp[]>,
|
|
|
+ default: [],
|
|
|
+ },
|
|
|
},
|
|
|
setup(props, context) {
|
|
|
+ const goodscode = findGoodsCode(props.selectedRow.goodsid, props.selectedRow.goodscode, props.swapList);
|
|
|
+
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
const { rules, formState, formRef } = handleForm();
|
|
|
// 选中逻辑
|
|
|
@@ -135,17 +146,33 @@ export default defineComponent({
|
|
|
userid: getUserId(),
|
|
|
goodsid: props.selectedRow.goodsid,
|
|
|
};
|
|
|
+ // 估算金额=估算价*平仓数量*合约单位。
|
|
|
+ function getMoney() {
|
|
|
+ let result = '--';
|
|
|
+ const lastPrice = getQuoteDayInfoByCodeFindPrice(goodscode);
|
|
|
+ if (lastPrice && lastPrice !== '--' && selected.value) {
|
|
|
+ const { holderqty, agreeunit, decimalplace } = selected.value;
|
|
|
+ result = (+lastPrice * holderqty * agreeunit).toFixed(decimalplace);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
queryTable(queryTradeHolderDetail, param).then((res) => {
|
|
|
+ let index = 0; // 默认勾选
|
|
|
tableList.value = res.map((e, i) => {
|
|
|
- if (i) {
|
|
|
- return { ...e, checked: false };
|
|
|
+ if (index === i) {
|
|
|
+ if (e.holderdays === 0) {
|
|
|
+ checked.value = e.tradeid;
|
|
|
+ const result = { ...e, checked: true };
|
|
|
+ selected.value = result;
|
|
|
+ index = -1;
|
|
|
+ return result;
|
|
|
+ } else {
|
|
|
+ index++;
|
|
|
+ return { ...e, checked: false };
|
|
|
+ }
|
|
|
} else {
|
|
|
- // 默认勾选第一个
|
|
|
- checked.value = e.tradeid;
|
|
|
- const result = { ...e, checked: true };
|
|
|
- selected.value = result;
|
|
|
- return result;
|
|
|
+ return { ...e, checked: false };
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
@@ -193,6 +220,10 @@ export default defineComponent({
|
|
|
checkboxChange,
|
|
|
BuyOrSell,
|
|
|
formatTime,
|
|
|
+ useProfit,
|
|
|
+ goodscode,
|
|
|
+ getQuoteDayInfoByCodeFindPrice,
|
|
|
+ getMoney,
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
@@ -257,7 +288,7 @@ export default defineComponent({
|
|
|
width: 100%;
|
|
|
height: 40px;
|
|
|
line-height: 40px;
|
|
|
- font-size: 16px;
|
|
|
+ font-size: 12px;
|
|
|
color: @m-white6;
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|